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 --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}}'
37 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
38 when: outputs is defined
39 failed_when: outputs|failed
40 ##################################################
41 # Per step starting of the containers using paunch
42 ##################################################
43 - name: Check if /var/lib/hashed-tripleo-config/docker-container-startup-config-step_{{step}}.json exists
45 path: /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
46 register: docker_config_json
47 # Note docker-puppet.py generates the hashed-*.json file, which is a copy of
48 # the *step_n.json with a hash of the generated external config added
49 # This acts as a salt to enable restarting the container if config changes
50 - name: Start containers for step {{step}}
53 --file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
54 --config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}}
55 when: docker_config_json.stat.exists
61 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
62 when: outputs is defined
63 failed_when: outputs|failed
64 ########################################################
65 # Bootstrap tasks, only performed on bootstrap_server_id
66 ########################################################
67 - name: Run docker-puppet tasks (bootstrap tasks)
68 shell: python /var/lib/docker-puppet/docker-puppet.py
70 CONFIG: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
74 when: deploy_server_id == bootstrap_server_id
80 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
81 when: outputs is defined
82 failed_when: outputs|failed