Merge "puppet: don't run module install steps multiple times"
This commit is contained in:
commit
cd4d940f64
@ -11,6 +11,3 @@ mgmt_hieradata: /etc/ansible/hosts
|
|||||||
mgmt_puppet_module_dir: /etc/puppet/modules
|
mgmt_puppet_module_dir: /etc/puppet/modules
|
||||||
puppet_hieradata_link_dest: /opt/system-config/hieradata
|
puppet_hieradata_link_dest: /opt/system-config/hieradata
|
||||||
puppet_nolog_sync: '{{ silence_synchronize }}'
|
puppet_nolog_sync: '{{ silence_synchronize }}'
|
||||||
|
|
||||||
ansible_roles:
|
|
||||||
- puppet
|
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
|
- hosts: 'localhost:!disabled'
|
||||||
|
name: Install puppet role/modules
|
||||||
|
strategy: linear
|
||||||
|
roles:
|
||||||
|
- puppet-setup-ansible
|
||||||
|
|
||||||
- hosts: "afs:afsdb:!disabled"
|
- hosts: "afs:afsdb:!disabled"
|
||||||
name: "AFS: run puppet on the AFS servers"
|
name: "AFS: run puppet on the AFS servers"
|
||||||
strategy: free
|
strategy: free
|
||||||
roles:
|
roles:
|
||||||
- run-puppet
|
- puppet-run
|
||||||
|
|
||||||
- hosts: "mirror-update:!disabled"
|
- hosts: "mirror-update:!disabled"
|
||||||
name: "Create key for remote vos release"
|
name: "Create key for remote vos release"
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
|
- hosts: 'localhost:!disabled'
|
||||||
|
name: Install puppet role/modules
|
||||||
|
strategy: linear
|
||||||
|
roles:
|
||||||
|
- puppet-setup-ansible
|
||||||
|
|
||||||
- hosts: 'puppet:!review:!afs:!afsdb:!puppetmaster*:!nb*:!codesearch:!eavesdrop:!disabled'
|
- hosts: 'puppet:!review:!afs:!afsdb:!puppetmaster*:!nb*:!codesearch:!eavesdrop:!disabled'
|
||||||
name: "Puppet-else: run puppet on all other servers"
|
name: "Puppet-else: run puppet on all other servers"
|
||||||
strategy: free
|
strategy: free
|
||||||
roles:
|
roles:
|
||||||
- run-puppet
|
- puppet-run
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
repo: '{{ ansible_role_src_root }}/src/opendev.org/opendev/ansible-role-{{ ansible_role }}'
|
repo: '{{ ansible_role_src_root }}/src/opendev.org/opendev/ansible-role-{{ ansible_role }}'
|
||||||
dest: '/etc/ansible/roles/{{ ansible_role }}'
|
dest: '/etc/ansible/roles/{{ ansible_role }}'
|
||||||
force: yes
|
force: yes
|
||||||
delegate_to: localhost
|
|
||||||
run_once: true
|
|
||||||
loop: '{{ ansible_roles }}'
|
loop: '{{ ansible_roles }}'
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: ansible_role
|
loop_var: ansible_role
|
||||||
|
13
playbooks/roles/puppet-run/README.rst
Normal file
13
playbooks/roles/puppet-run/README.rst
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Run puppet on remote servers
|
||||||
|
|
||||||
|
Omnibus role that takes care of installing puppet and then running
|
||||||
|
puppet. Uses include_role so that the installation of the puppet role
|
||||||
|
can run as the first task, then the puppet role can be used in a
|
||||||
|
following task.
|
||||||
|
|
||||||
|
This role should run after ``puppet-setup-ansible``
|
||||||
|
|
||||||
|
.. zuul:rolevar:: manifest
|
||||||
|
:default: manifests/site.pp
|
||||||
|
|
||||||
|
Puppet manifest file to run.
|
@ -1,19 +1,9 @@
|
|||||||
# Use include_role instead of roles: so that we can late-bind the roles list
|
# Use include_role instead of roles: so that we can late-bind the roles list
|
||||||
- include_role:
|
- include_role:
|
||||||
name: iptables
|
name: iptables
|
||||||
- include_role:
|
|
||||||
name: install-ansible-roles
|
|
||||||
- include_role:
|
- include_role:
|
||||||
name: puppet-install
|
name: puppet-install
|
||||||
- include_role:
|
- include_role:
|
||||||
name: disable-puppet-agent
|
name: disable-puppet-agent
|
||||||
|
|
||||||
- name: Run puppet module install
|
|
||||||
delegate_to: localhost
|
|
||||||
run_once: true
|
|
||||||
command:
|
|
||||||
cmd: bash install_modules.sh
|
|
||||||
chdir: /etc/puppet
|
|
||||||
|
|
||||||
- include_role:
|
- include_role:
|
||||||
name: puppet
|
name: puppet
|
5
playbooks/roles/puppet-setup-ansible/README.rst
Normal file
5
playbooks/roles/puppet-setup-ansible/README.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Setup Ansible on this host to run puppet on remote hosts.
|
||||||
|
|
||||||
|
Import the ansible-roles-puppet role for running puppet on remote
|
||||||
|
hosts and bring in the repository of required puppet modules.
|
||||||
|
|
10
playbooks/roles/puppet-setup-ansible/tasks/main.yaml
Normal file
10
playbooks/roles/puppet-setup-ansible/tasks/main.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
- include_role:
|
||||||
|
name: install-ansible-roles
|
||||||
|
vars:
|
||||||
|
ansible_roles:
|
||||||
|
- puppet
|
||||||
|
|
||||||
|
- name: Run puppet module install on bridge
|
||||||
|
command:
|
||||||
|
cmd: bash install_modules.sh
|
||||||
|
chdir: /etc/puppet
|
@ -1,12 +0,0 @@
|
|||||||
Run puppet on remote servers
|
|
||||||
|
|
||||||
Omnibus role that takes care of installing the puppet role,
|
|
||||||
installing puppet and then running puppet. Uses include_role
|
|
||||||
so that the installation of the puppet role can run as the
|
|
||||||
first task, then the puppet role can be used in a following
|
|
||||||
task.
|
|
||||||
|
|
||||||
.. zuul:rolevar:: manifest
|
|
||||||
:default: manifests/site.pp
|
|
||||||
|
|
||||||
Puppet manifest file to run.
|
|
@ -1,3 +1,9 @@
|
|||||||
|
- hosts: 'localhost:!disabled'
|
||||||
|
name: Install puppet role/modules
|
||||||
|
strategy: linear
|
||||||
|
roles:
|
||||||
|
- puppet-setup-ansible
|
||||||
|
|
||||||
- hosts: 'codesearch:!disabled'
|
- hosts: 'codesearch:!disabled'
|
||||||
name: "codesearch: run puppet on codesearch"
|
name: "codesearch: run puppet on codesearch"
|
||||||
strategy: free
|
strategy: free
|
||||||
@ -5,5 +11,5 @@
|
|||||||
- iptables
|
- iptables
|
||||||
- sync-project-config
|
- sync-project-config
|
||||||
- pip3
|
- pip3
|
||||||
- name: run-puppet
|
- name: puppet-run
|
||||||
manifest: /opt/system-config/production/manifests/codesearch.pp
|
manifest: /opt/system-config/production/manifests/codesearch.pp
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
- hosts: 'localhost:!disabled'
|
||||||
|
name: Install puppet role/modules
|
||||||
|
strategy: linear
|
||||||
|
roles:
|
||||||
|
- puppet-setup-ansible
|
||||||
|
|
||||||
- hosts: 'eavesdrop:!disabled'
|
- hosts: 'eavesdrop:!disabled'
|
||||||
name: "eavesdrop: run puppet on eavesdrop"
|
name: "eavesdrop: run puppet on eavesdrop"
|
||||||
strategy: free
|
strategy: free
|
||||||
@ -8,5 +14,5 @@
|
|||||||
- install-docker
|
- install-docker
|
||||||
- accessbot
|
- accessbot
|
||||||
- gerritbot
|
- gerritbot
|
||||||
- name: run-puppet
|
- name: puppet-run
|
||||||
manifest: /opt/system-config/production/manifests/eavesdrop.pp
|
manifest: /opt/system-config/production/manifests/eavesdrop.pp
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
- configure-openstacksdk
|
- configure-openstacksdk
|
||||||
- nodepool-builder
|
- nodepool-builder
|
||||||
|
|
||||||
|
- hosts: 'localhost:!disabled'
|
||||||
|
name: Install puppet role/modules
|
||||||
|
strategy: linear
|
||||||
|
roles:
|
||||||
|
- puppet-setup-ansible
|
||||||
|
|
||||||
- hosts: 'nb03.openstack.org:!disabled'
|
- hosts: 'nb03.openstack.org:!disabled'
|
||||||
name: "run puppet on all older servers"
|
name: "run puppet on all older servers"
|
||||||
strategy: free
|
strategy: free
|
||||||
@ -16,7 +22,7 @@
|
|||||||
- nodepool-base-legacy
|
- nodepool-base-legacy
|
||||||
- configure-openstacksdk
|
- configure-openstacksdk
|
||||||
- configure-kubectl
|
- configure-kubectl
|
||||||
- run-puppet
|
- puppet-run
|
||||||
|
|
||||||
- hosts: nodepool-launcher:!disabled
|
- hosts: nodepool-launcher:!disabled
|
||||||
name: "Configure nodepool launchers"
|
name: "Configure nodepool launchers"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user