aboutsummaryrefslogtreecommitdiffstats
path: root/docker/deploy-steps-playbook.yaml
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2017-05-03 17:12:55 +0100
committerSteven Hardy <shardy@redhat.com>2017-06-06 15:44:01 +0100
commit03811f176a9a28e4c41a211fef6a2de4392dd159 (patch)
tree31e7e6bd97443b98e4c1e220a932a77ec0238564 /docker/deploy-steps-playbook.yaml
parentda86aacb66eaa5e009206ed698a4189e8f5e0e1d (diff)
Convert puppet and docker steps to ansible
Replace the multiple SoftwareDeployment resources with a common playbook that runs on all roles, consuming the configuration data written via the HostPrepAnsible tasks. This hopefully simplifies things, and will enable re-running the deploy steps for minor updates (we'll need some way to detect a container should be replaced, but that will be done via a follow-up patch). Change-Id: I674a4d9d2c77d1f6fbdb0996f6c9321848e32662
Diffstat (limited to 'docker/deploy-steps-playbook.yaml')
-rw-r--r--docker/deploy-steps-playbook.yaml47
1 files changed, 47 insertions, 0 deletions
diff --git a/docker/deploy-steps-playbook.yaml b/docker/deploy-steps-playbook.yaml
new file mode 100644
index 00000000..a0beaa2c
--- /dev/null
+++ b/docker/deploy-steps-playbook.yaml
@@ -0,0 +1,47 @@
+- hosts: localhost
+ connection: local
+ tasks:
+ #####################################################
+ # Per step puppet configuration of the baremetal host
+ #####################################################
+ - name: Write the config_step hieradata
+ copy: content="{{dict(step=step|int)|to_json}}" dest=/etc/puppet/hieradata/config_step.json force=true
+ - name: Run puppet host configuration for step {{step}}
+ # FIXME: modulepath requires ansible 2.4, our builds currently only have 2.3
+ # puppet: manifest=/var/lib/tripleo-config/puppet_step_config.pp modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
+ puppet: manifest=/var/lib/tripleo-config/puppet_step_config.pp
+ ######################################
+ # Generate config via docker-puppet.py
+ ######################################
+ - name: Run docker-puppet tasks (generate config)
+ shell: python /var/lib/docker-puppet/docker-puppet.py
+ environment:
+ NET_HOST: 'true'
+ when: step == "1"
+ changed_when: false
+ check_mode: no
+ ##################################################
+ # Per step starting of the containers using paunch
+ ##################################################
+ - name: Check if /var/lib/tripleo-config/docker-container-startup-config-step_{{step}}.json exists
+ stat:
+ path: /var/lib/tripleo-config/docker-container-startup-config-step_{{step}}.json
+ register: docker_config_json
+ - name: Start containers for step {{step}}
+ command: paunch --debug apply --file /var/lib/tripleo-config/docker-container-startup-config-step_{{step}}.json --config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}}
+ when: docker_config_json.stat.exists
+ changed_when: false
+ check_mode: no
+ ########################################################
+ # Bootstrap tasks, only performed on bootstrap_server_id
+ ########################################################
+ - name: Run docker-puppet tasks (bootstrap tasks)
+ shell: python /var/lib/docker-puppet/docker-puppet.py
+ environment:
+ CONFIG: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
+ NET_HOST: "true"
+ NO_ARCHIVE: "true"
+ STEP: "{{step}}"
+ when: deploy_server_id == bootstrap_server_id
+ changed_when: false
+ check_mode: no