Browse Source

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
changes/03/504103/4
James Slagle 4 years ago
parent
commit
bb24fbfef3
  1. 7
      common/deploy-steps-tasks.yaml
  2. 6
      releasenotes/notes/use-become-true-in-deploy-steps-playbook-01decb18d895879f.yaml

7
common/deploy-steps-tasks.yaml

@ -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

6
releasenotes/notes/use-become-true-in-deploy-steps-playbook-01decb18d895879f.yaml

@ -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".
Loading…
Cancel
Save