diff --git a/inventory/host_vars/jenkins.fedorainfracloud.org b/inventory/host_vars/jenkins.fedorainfracloud.org index 568a7dfb5e..29db3a4bde 100644 --- a/inventory/host_vars/jenkins.fedorainfracloud.org +++ b/inventory/host_vars/jenkins.fedorainfracloud.org @@ -17,8 +17,6 @@ cloud_networks: # persistent-net - net-id: "67b77354-39a4-43de-b007-bb813ac5c35f" -jenkins_master: True - tcp_ports: [ 8080 ] custom_nat_rules: [ diff --git a/inventory/inventory b/inventory/inventory index fffbf1cfff..ea8480c51a 100644 --- a/inventory/inventory +++ b/inventory/inventory @@ -886,8 +886,10 @@ jenkins-slaves # # These are in the new cloud # -[jenkins-dev] +[jenkins-master] jenkins.fedorainfracloud.org + +[jenkins-slave] jenkins-slave-el6.fedorainfracloud.org jenkins-slave-el7.fedorainfracloud.org jenkins-slave-f22.fedorainfracloud.org diff --git a/playbooks/groups/jenkins-dev.yml b/playbooks/groups/jenkins-master.yml similarity index 84% rename from playbooks/groups/jenkins-dev.yml rename to playbooks/groups/jenkins-master.yml index ef8fdcc5c9..1bd8d4de75 100644 --- a/playbooks/groups/jenkins-dev.yml +++ b/playbooks/groups/jenkins-master.yml @@ -1,5 +1,5 @@ - name: check/create instance - hosts: jenkins-dev + hosts: jenkins-master gather_facts: False vars_files: @@ -12,7 +12,7 @@ - include: "{{ tasks }}/persistent_cloud_new.yml" - name: setup all the things - hosts: jenkins-dev + hosts: jenkins-master gather_facts: True vars_files: - /srv/web/infra/ansible/vars/global.yml @@ -27,7 +27,7 @@ - include: "{{ tasks }}/yumrepos.yml" - name: provision instance - hosts: jenkins-dev + hosts: jenkins-master vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/private/ansible/vars.yml" @@ -35,8 +35,7 @@ roles: - base - - { role: jenkins/master, when: jenkins_master is defined } - - { role: jenkins/slave, when: jenkins_master is not defined } + - jenkins/master handlers: - include: "{{ handlers }}/restart_services.yml" diff --git a/playbooks/groups/jenkins-slave.yml b/playbooks/groups/jenkins-slave.yml new file mode 100644 index 0000000000..db2739c4aa --- /dev/null +++ b/playbooks/groups/jenkins-slave.yml @@ -0,0 +1,41 @@ +- name: check/create instance + hosts: jenkins-slave + gather_facts: False + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - /srv/private/ansible/vars.yml + - /srv/web/infra/ansible/vars/fedora-cloud.yml + - /srv/private/ansible/files/openstack/passwords.yml + + tasks: + - include: "{{ tasks }}/persistent_cloud_new.yml" + +- name: setup all the things + hosts: jenkins-slave + gather_facts: True + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - /srv/private/ansible/vars.yml + - /srv/private/ansible/files/openstack/passwords.yml + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + pre_tasks: + - include: "{{ tasks }}/cloud_setup_basic.yml" + - name: set hostname (required by some services, at least postfix need it) + shell: "hostname {{inventory_hostname}}" + - include: "{{ tasks }}/yumrepos.yml" + +- name: provision instance + hosts: jenkins-slave + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + roles: + - base + - jenkins/slave + + handlers: + - include: "{{ handlers }}/restart_services.yml"