1 # Note the indentation here is required as it's joined
2 # to create a playbook in deploy-steps.j2
4 #####################################################
5 # Per step puppet configuration of the baremetal host
6 #####################################################
7 - name: Write the config_step hieradata
8 copy: content="{{dict(step=step|int)|to_json}}" dest=/etc/puppet/hieradata/config_step.json force=true
9 - name: Run puppet host configuration for step {{step}}
12 --modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
13 --logdest syslog --logdest console --color=false
14 /var/lib/tripleo-config/puppet_step_config.pp
20 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
21 when: outputs is defined
22 failed_when: outputs|failed
23 ######################################
24 # Generate config via docker-puppet.py
25 ######################################
26 - name: Run docker-puppet tasks (generate config)
27 shell: python /var/lib/docker-puppet/docker-puppet.py
30 DEBUG: '{{docker_puppet_debug|default(false)}}'
31 PROCESS_COUNT: '{{docker_puppet_process_count|default(3)}}'
38 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
39 when: outputs is defined
40 failed_when: outputs|failed
41 ##################################################
42 # Per step starting of the containers using paunch
43 ##################################################
44 - name: Check if /var/lib/hashed-tripleo-config/docker-container-startup-config-step_{{step}}.json exists
46 path: /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
47 register: docker_config_json
48 # Note docker-puppet.py generates the hashed-*.json file, which is a copy of
49 # the *step_n.json with a hash of the generated external config added
50 # This acts as a salt to enable restarting the container if config changes
51 - name: Start containers for step {{step}}
54 --file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
55 --config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}}
56 when: docker_config_json.stat.exists
62 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
63 when: outputs is defined
64 failed_when: outputs|failed
65 ########################################################
66 # Bootstrap tasks, only performed on bootstrap_server_id
67 ########################################################
68 - name: Check if /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json exists
70 path: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
71 register: docker_puppet_tasks_json
72 - name: Run docker-puppet tasks (bootstrap tasks)
73 shell: python /var/lib/docker-puppet/docker-puppet.py
75 CONFIG: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
79 when: deploy_server_id == bootstrap_server_id and docker_puppet_tasks_json.stat.exists
85 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
86 when: outputs is defined
87 failed_when: outputs|failed