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: Set host puppet debugging fact string
9 host_puppet_config_debug: "--debug --verbose"
10 when: enable_debug|default(false)
11 - name: Write the config_step hieradata
12 copy: content="{{dict(step=step|int)|to_json}}" dest=/etc/puppet/hieradata/config_step.json force=true mode=0600
13 - name: Run puppet host configuration for step {{step}}
15 puppet apply {{ host_puppet_config_debug|default('') }}
16 --modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
17 --logdest syslog --logdest console --color=false
18 /var/lib/tripleo-config/puppet_step_config.pp
24 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
25 when: outputs is defined
26 failed_when: outputs|failed
27 ######################################
28 # Generate config via docker-puppet.py
29 ######################################
30 - name: Run docker-puppet tasks (generate config)
31 shell: python /var/lib/docker-puppet/docker-puppet.py
34 DEBUG: '{{docker_puppet_debug|default(false)}}'
35 PROCESS_COUNT: '{{docker_puppet_process_count|default(3)}}'
42 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
43 when: outputs is defined
44 failed_when: outputs|failed
45 ##################################################
46 # Per step starting of the containers using paunch
47 ##################################################
48 - name: Check if /var/lib/hashed-tripleo-config/docker-container-startup-config-step_{{step}}.json exists
50 path: /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
51 register: docker_config_json
52 # Note docker-puppet.py generates the hashed-*.json file, which is a copy of
53 # the *step_n.json with a hash of the generated external config added
54 # This acts as a salt to enable restarting the container if config changes
55 - name: Start containers for step {{step}}
58 --file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
59 --config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}}
60 when: docker_config_json.stat.exists
66 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
67 when: outputs is defined
68 failed_when: outputs|failed
69 ########################################################
70 # Bootstrap tasks, only performed on bootstrap_server_id
71 ########################################################
72 - name: Check if /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json exists
74 path: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
75 register: docker_puppet_tasks_json
76 - name: Run docker-puppet tasks (bootstrap tasks)
77 shell: python /var/lib/docker-puppet/docker-puppet.py
79 CONFIG: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
83 when: deploy_server_id == bootstrap_server_id and docker_puppet_tasks_json.stat.exists
89 - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
90 when: outputs is defined
91 failed_when: outputs|failed