Use "become: true" in deploy steps tasks

In the deploy steps playbook downloaded via "openstack overcloud config
download", all the tasks require sudo. The tasks should use "become:
true", otherwise they fail with permission denied errors.

Change-Id: I561b5ef6dee0ee7cac67ba798eda284fb7f7a8d0
Closes-Bug: #1717298
This commit is contained in:
James Slagle 2017-09-14 10:08:07 -06:00
parent 155a32fecc
commit bb24fbfef3
2 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#####################################################
- name: Write the config_step hieradata
copy: content="{{dict(step=step|int)|to_json}}" dest=/etc/puppet/hieradata/config_step.json force=true mode=0600
become: true
- name: Run puppet host configuration for step {{step}}
command: >-
puppet apply
@ -17,6 +18,7 @@
register: outputs
failed_when: false
no_log: true
become: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
when: outputs is defined
failed_when: outputs|failed
@ -35,6 +37,7 @@
register: outputs
failed_when: false
no_log: true
become: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
when: outputs is defined
failed_when: outputs|failed
@ -45,6 +48,7 @@
stat:
path: /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
register: docker_config_json
become: true
# Note docker-puppet.py generates the hashed-*.json file, which is a copy of
# the *step_n.json with a hash of the generated external config added
# This acts as a salt to enable restarting the container if config changes
@ -59,6 +63,7 @@
register: outputs
failed_when: false
no_log: true
become: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
when: outputs is defined
failed_when: outputs|failed
@ -69,6 +74,7 @@
stat:
path: /var/lib/docker-puppet/docker-puppet-tasks{{step}}.json
register: docker_puppet_tasks_json
become: true
- name: Run docker-puppet tasks (bootstrap tasks)
shell: python /var/lib/docker-puppet/docker-puppet.py
environment:
@ -82,6 +88,7 @@
register: outputs
failed_when: false
no_log: true
become: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
when: outputs is defined
failed_when: outputs|failed

View File

@ -0,0 +1,6 @@
---
fixes:
- >
In the deploy steps playbook downloaded via
"openstack overcloud config download", all the tasks
require sudo. The tasks now use "become: true".