Hi all,
We have come up with scripts[1] to deploy CentOS Community Container Pipeline(CCCP, in short). A typical CCCP setup comprises of 3 nodes: Jenkins master, Jenkins slave, Openshift server. To ease the setup of this multi node environment, we have created a Vagrantfile[2] to get you started with your CCCP setup in no time.
Special thanks to Dharmit Shah and Praveen Kumar to help me out with testing and improving these deployment scripts.
Below is the set of instructions to get you started with CCCP. You can also find the latest and updated set of instructions here[3].
Setup =====
sudo yum install -y epel-release git # We are installing Ansible from pip because there's a bug in Ansible Docker module in EPEL sudo yum install -y python-pip sudo pip install ansible sudo yum install centos-release-scl qemu-kvm libvirt sudo yum -y install sclo-vagrant1 sudo yum install python2-jenkins-job-builder
# start libvirtd sudo systemctl start libvirtd; sudo systemctl enable libvirtd
# enable bash on vagrant scl sudo scl enable sclo-vagrant1 bash
Deploy =====
git clone https://github.com/rtnpro/centos-cccp-ansible cd centos-cccp-ansible vagrant plugin install vagrant-hostmanager vagrant up --no-provision vagrant provision
Configure Jenkins Job Builder ======================
Create file /etc/jenkins_jobs/jenkins_jobs.ini with content similar to:
[jenkins] user=admin password=admin url=http://cccp-master.example.com:8080/
Push jobs to jenkins ===============
Clone the repos in the same directory:
git clone https://github.com/bamachrn/cccp-service.git git clone https://github.com/kbsingh/cccp-index.git
Then do:
cd cccp-service/jenkinsbuilder python cccp_index_reader.py ../../cccp-index/index.yml
And wait for the jobs for the projects in the index to be pushed to Jenkins.
Please share your feedback with us. Let us know if you have any query.
[1]: https://github.com/rtnpro/centos-cccp-ansible [2]: https://github.com/rtnpro/centos-cccp-ansible/blob/master/Vagrantfile [3]: https://gist.github.com/rtnpro/e903918b78ba57634b8890996739d0b7
Thanks, rtnpro
On 18/04/16 13:03, Ratnadeep Debnath wrote:
# We are installing Ansible from pip because there's a bug in Ansible Docker module in EPEL sudo yum install -y python-pip sudo pip install ansible
Do you have details for this bug in epel ?
On 04/25/2016 06:47 PM, Karanbir Singh wrote:
On 18/04/16 13:03, Ratnadeep Debnath wrote:
# We are installing Ansible from pip because there's a bug in Ansible Docker module in EPEL sudo yum install -y python-pip sudo pip install ansible
Do you have details for this bug in epel ?
Instead of installing from pip, it's possible to get over this error by installing `ansible1.9` from EPEL. There are two Ansible packages in EPEL at the moment [0].
[0] https://dl.fedoraproject.org/pub/epel/7/x86_64/repoview/letter_a.group.html
Regards, Dharmit.
On 04/25/2016 07:13 PM, Dharmit Shah wrote:
Instead of installing from pip, it's possible to get over this error by installing `ansible1.9` from EPEL. There are two Ansible packages in EPEL at the moment [0].
Forgot to mention *what* error it was. Here's the link to GitHub issue [1].
[1] https://github.com/ansible/ansible-modules-core/issues/2611
[0] https://dl.fedoraproject.org/pub/epel/7/x86_64/repoview/letter_a.group.html
Regards, Dharmit.
On 25/04/16 14:49, Dharmit Shah wrote:
On 04/25/2016 07:13 PM, Dharmit Shah wrote:
Instead of installing from pip, it's possible to get over this error by installing `ansible1.9` from EPEL. There are two Ansible packages in EPEL at the moment [0].
Forgot to mention *what* error it was. Here's the link to GitHub issue [1].
[1] https://github.com/ansible/ansible-modules-core/issues/2611
fixed in Dec 2015...
- KB
On Mon, 25 Apr 2016 15:46:31 +0100 Karanbir Singh mail-lists@karan.org wrote:
On 25/04/16 14:49, Dharmit Shah wrote:
On 04/25/2016 07:13 PM, Dharmit Shah wrote:
Instead of installing from pip, it's possible to get over this error by installing `ansible1.9` from EPEL. There are two Ansible packages in EPEL at the moment [0].
Forgot to mention *what* error it was. Here's the link to GitHub issue [1].
[1] https://github.com/ansible/ansible-modules-core/issues/2611
fixed in Dec 2015...
The docker module in both 1.9.x and 2.0.x have been re-written since then, so it's unclear to me if that fix is still there or needed.
If it works with ansible 1.9.x (epel ansible1.9 package) but not 2.0.x (epel ansible package), or neither of them, please report a upstream bug on it so they know it's happening again. None of the ansible folks will see a closed bug from 2015 as needing looking at. ;)
kevin
On 25/04/16 14:43, Dharmit Shah wrote:
Instead of installing from pip, it's possible to get over this error by installing `ansible1.9` from EPEL. There are two Ansible packages in EPEL at the moment [0].
thanks
let me script this up and we can get a ci.centos.org job around this. but at the moment the ansible piece breaks with a key issue, we need to get that fixed first.
one for you Ratnadeep ?
On Mon, Apr 25, 2016 at 8:17 PM, Karanbir Singh mail-lists@karan.org wrote:
On 25/04/16 14:43, Dharmit Shah wrote:
Instead of installing from pip, it's possible to get over this error by installing `ansible1.9` from EPEL. There are two Ansible packages in EPEL at the moment [0].
thanks
let me script this up and we can get a ci.centos.org job around this. but at the moment the ansible piece breaks with a key issue, we need to get that fixed first.
Ansible or the playbook roles? key issue? any error log or traceback?
Thanks, rtnpro
On 25/04/16 17:09, Ratnadeep Debnath wrote:
let me script this up and we can get a ci.centos.org job around this. but at the moment the ansible piece breaks with a key issue, we need to get that fixed first.
Ansible or the playbook roles? key issue? any error log or traceback?
having now done a ssh-keygen -t rsa; i can get beyond that point, but now it fails with :
TASK [jenkins/master : Install Jenkins plugins.] ******************************* [DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{jenkins_plugins}}'). This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. failed: [master] (item=git) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins-cli.jar", "-s", "http://localhost:8080/", "install-plugin", "git"], "delta": "0:00:00.121230", "end": "2016-04-25 12:24:07.747697", "failed": true, "item": "git", "rc": 255, "start": "2016-04-25 12:24:07.626467", "stderr": "java.io.IOException: No X-Jenkins-CLI2-Port among [null, X-Required-Permission, X-Jenkins, X-You-Are-In-Group, X-Hudson, Content-Length, Expires, X-You-Are-Authenticated-As, X-Permission-Implied-By, Set-Cookie, Server, X-Content-Type-Options, Date, X-Jenkins-Session, Content-Type]\n\tat hudson.cli.CLI.getCliTcpPort(CLI.java:290)\n\tat hudson.cli.CLI.<init>(CLI.java:128)\n\tat hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)\n\tat hudson.cli.CLI._main(CLI.java:479)\n\tat hudson.cli.CLI.main(CLI.java:390)\n\tSuppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/cli%5Cn%5Ct%5Ctat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1628)\n\t\tat hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)\n\t\tat hudson.cli.CLI.connectViaHttp(CLI.java:158)\n\t\tat hudson.cli.CLI.<init>(CLI.java:132)\n\t\t... 3 more", "stdout": "", "stdout_lines": [], "warnings": []} failed: [master] (item=ssh) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins-cli.jar", "-s", "http://localhost:8080/", "install-plugin", "ssh"], "delta": "0:00:00.115192", "end": "2016-04-25 12:24:08.054622", "failed": true, "item": "ssh", "rc": 255, "start": "2016-04-25 12:24:07.939430", "stderr": "java.io.IOException: No X-Jenkins-CLI2-Port among [null, X-Required-Permission, X-Jenkins, X-You-Are-In-Group, X-Hudson, Content-Length, Expires, X-You-Are-Authenticated-As, X-Permission-Implied-By, Set-Cookie, Server, X-Content-Type-Options, Date, X-Jenkins-Session, Content-Type]\n\tat hudson.cli.CLI.getCliTcpPort(CLI.java:290)\n\tat hudson.cli.CLI.<init>(CLI.java:128)\n\tat hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)\n\tat hudson.cli.CLI._main(CLI.java:479)\n\tat hudson.cli.CLI.main(CLI.java:390)\n\tSuppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/cli%5Cn%5Ct%5Ctat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1628)\n\t\tat hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)\n\t\tat hudson.cli.CLI.connectViaHttp(CLI.java:158)\n\t\tat hudson.cli.CLI.<init>(CLI.java:132)\n\t\t... 3 more", "stdout": "", "stdout_lines": [], "warnings": []} failed: [master] (item=multiple-scms) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins-cli.jar", "-s", "http://localhost:8080/", "install-plugin", "multiple-scms"], "delta": "0:00:00.115100", "end": "2016-04-25 12:24:08.377457", "failed": true, "item": "multiple-scms", "rc": 255, "start": "2016-04-25 12:24:08.262357", "stderr": "java.io.IOException: No X-Jenkins-CLI2-Port among [null, X-Required-Permission, X-Jenkins, X-You-Are-In-Group, X-Hudson, Content-Length, Expires, X-You-Are-Authenticated-As, X-Permission-Implied-By, Set-Cookie, Server, X-Content-Type-Options, Date, X-Jenkins-Session, Content-Type]\n\tat hudson.cli.CLI.getCliTcpPort(CLI.java:290)\n\tat hudson.cli.CLI.<init>(CLI.java:128)\n\tat hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)\n\tat hudson.cli.CLI._main(CLI.java:479)\n\tat hudson.cli.CLI.main(CLI.java:390)\n\tSuppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/cli%5Cn%5Ct%5Ctat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1628)\n\t\tat hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)\n\t\tat hudson.cli.CLI.connectViaHttp(CLI.java:158)\n\t\tat hudson.cli.CLI.<init>(CLI.java:132)\n\t\t... 3 more", "stdout": "", "stdout_lines": [], "warnings": []} failed: [master] (item=python) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins-cli.jar", "-s", "http://localhost:8080/", "install-plugin", "python"], "delta": "0:00:00.119087", "end": "2016-04-25 12:24:08.751636", "failed": true, "item": "python", "rc": 255, "start": "2016-04-25 12:24:08.632549", "stderr": "java.io.IOException: No X-Jenkins-CLI2-Port among [null, X-Required-Permission, X-Jenkins, X-You-Are-In-Group, X-Hudson, Content-Length, Expires, X-You-Are-Authenticated-As, X-Permission-Implied-By, Set-Cookie, Server, X-Content-Type-Options, Date, X-Jenkins-Session, Content-Type]\n\tat hudson.cli.CLI.getCliTcpPort(CLI.java:290)\n\tat hudson.cli.CLI.<init>(CLI.java:128)\n\tat hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)\n\tat hudson.cli.CLI._main(CLI.java:479)\n\tat hudson.cli.CLI.main(CLI.java:390)\n\tSuppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/cli%5Cn%5Ct%5Ctat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1628)\n\t\tat hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)\n\t\tat hudson.cli.CLI.connectViaHttp(CLI.java:158)\n\t\tat hudson.cli.CLI.<init>(CLI.java:132)\n\t\t... 3 more", "stdout": "", "stdout_lines": [], "warnings": []} failed: [master] (item=ws-cleanup) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins-cli.jar", "-s", "http://localhost:8080/", "install-plugin", "ws-cleanup"], "delta": "0:00:00.119134", "end": "2016-04-25 12:24:09.105226", "failed": true, "item": "ws-cleanup", "rc": 255, "start": "2016-04-25 12:24:08.986092", "stderr": "java.io.IOException: No X-Jenkins-CLI2-Port among [null, X-Required-Permission, X-Jenkins, X-You-Are-In-Group, X-Hudson, Content-Length, Expires, X-You-Are-Authenticated-As, X-Permission-Implied-By, Set-Cookie, Server, X-Content-Type-Options, Date, X-Jenkins-Session, Content-Type]\n\tat hudson.cli.CLI.getCliTcpPort(CLI.java:290)\n\tat hudson.cli.CLI.<init>(CLI.java:128)\n\tat hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)\n\tat hudson.cli.CLI._main(CLI.java:479)\n\tat hudson.cli.CLI.main(CLI.java:390)\n\tSuppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/cli%5Cn%5Ct%5Ctat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1628)\n\t\tat hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)\n\t\tat hudson.cli.CLI.connectViaHttp(CLI.java:158)\n\t\tat hudson.cli.CLI.<init>(CLI.java:132)\n\t\t... 3 more", "stdout": "", "stdout_lines": [], "warnings": []} to retry, use: --limit @vagrant.retry
PLAY RECAP ********************************************************************* master : ok=17 changed=7 unreachable=0 failed=1 node1 : ok=3 changed=1 unreachable=0 failed=0 node2 : ok=7 changed=3 unreachable=0 failed=0
Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.
On 04/25/2016 08:17 PM, Karanbir Singh wrote:
but at the moment the ansible piece breaks with a key issue, we need to get that fixed first.
I think this breaks because playbook copies SSH key from the host to the Vagrant box. On a fresh system, there's very high chances of this failing.
Regards, Dharmit.
On 18/04/16 13:03, Ratnadeep Debnath wrote:
sudo yum install -y python-pip
you also need "gcc autoconf python-devel" in the yum command above ^
sudo pip install ansible
On 18/04/16 13:03, Ratnadeep Debnath wrote:
vagrant provision
this fails with:
TASK [jenkins/slave : add jenkins ssh public key to authorized keys] *********** fatal: [node2]: FAILED! => {"failed": true, "msg": "the file_name '/root/.ssh/id_rsa.pub' does not exist, or is not readable"}