Replace become: true notation
Ansible documentation recommends to use yes/no as boolean value, the last mention of possible using true/yes related to version 2.4 [1]. Starting from version 2.5 only become: yes specified in docs [2][3]. Since we have both variations, this patch aligns become statement to use only yes value. [1] https://docs.ansible.com/ansible/2.4/become.html [2] https://docs.ansible.com/ansible/2.5/user_guide/become.html [3] https://docs.ansible.com/ansible/latest/user_guide/become.html Change-Id: I706e6e1b9d706d6bfcc38c1a3d0d7304575946ce Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This commit is contained in:
parent
4e64e74b6f
commit
76d8716968
@ -29,7 +29,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: deploy-gate
|
- name: deploy-gate
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -25,15 +25,15 @@
|
|||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: copy configs
|
- name: copy configs
|
||||||
command: "cp -r /etc/apache2 {{ apache_log_dir }}/configs"
|
command: "cp -r /etc/apache2 {{ apache_log_dir }}/configs"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: copy logs
|
- name: copy logs
|
||||||
command: "cp -r /var/log/apache2 {{ apache_log_dir }}/logs"
|
command: "cp -r /var/log/apache2 {{ apache_log_dir }}/logs"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: Change ownership of the logs dir
|
- name: Change ownership of the logs dir
|
||||||
file:
|
file:
|
||||||
@ -41,7 +41,7 @@
|
|||||||
recurse: true
|
recurse: true
|
||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
path: "{{ apache_log_dir }}"
|
path: "{{ apache_log_dir }}"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: "Downloads logs to executor"
|
- name: "Downloads logs to executor"
|
||||||
synchronize:
|
synchronize:
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
|
|
||||||
- name: copy hypervisor logs to tmp directory
|
- name: copy hypervisor logs to tmp directory
|
||||||
command: "cp -r /var/log/libvirt {{ libvirt_log_dir }}/libvirt-hypervisor"
|
command: "cp -r /var/log/libvirt {{ libvirt_log_dir }}/libvirt-hypervisor"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: copy console logs to tmp directory
|
- name: copy console logs to tmp directory
|
||||||
command: "cp -r /var/log/libvirt-consoles/ {{ libvirt_log_dir }}/libvirt-consoles"
|
command: "cp -r /var/log/libvirt-consoles/ {{ libvirt_log_dir }}/libvirt-consoles"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: ensure libvirt resource dump directories exist
|
- name: ensure libvirt resource dump directories exist
|
||||||
file:
|
file:
|
||||||
@ -102,7 +102,7 @@
|
|||||||
recurse: true
|
recurse: true
|
||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
path: "{{ libvirt_log_dir }}"
|
path: "{{ libvirt_log_dir }}"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: Downloads logs to executor
|
- name: Downloads logs to executor
|
||||||
synchronize:
|
synchronize:
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
when: ansible_facts.services['docker.service'] is defined
|
when: ansible_facts.services['docker.service'] is defined
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: dump containerd logs
|
- name: dump containerd logs
|
||||||
shell: |-
|
shell: |-
|
||||||
@ -36,7 +36,7 @@
|
|||||||
when: ansible_facts.services['containerd.service'] is defined
|
when: ansible_facts.services['containerd.service'] is defined
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: "Downloads logs to executor"
|
- name: "Downloads logs to executor"
|
||||||
synchronize:
|
synchronize:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: build ephemeral node iso
|
- name: build ephemeral node iso
|
||||||
command: airshipctl baremetal isogen
|
command: airshipctl baremetal isogen
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
msg: "Only Debian|Ubuntu are currently supported"
|
msg: "Only Debian|Ubuntu are currently supported"
|
||||||
|
|
||||||
- name: Confguring file-exchanger
|
- name: Confguring file-exchanger
|
||||||
become: true
|
become: yes
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Ensure backend
|
- name: Ensure backend
|
||||||
|
@ -16,16 +16,16 @@
|
|||||||
service:
|
service:
|
||||||
name: "apache2"
|
name: "apache2"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: reload apache2
|
- name: reload apache2
|
||||||
service:
|
service:
|
||||||
name: "apache2"
|
name: "apache2"
|
||||||
state: "reloaded"
|
state: "reloaded"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: "restart httpd"
|
- name: "restart httpd"
|
||||||
service:
|
service:
|
||||||
name: "httpd"
|
name: "httpd"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
become: true
|
become: yes
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Generate htaccess file
|
- name: Generate htaccess file
|
||||||
become: true
|
become: yes
|
||||||
template:
|
template:
|
||||||
src: htaccess.j2
|
src: htaccess.j2
|
||||||
dest: "{{ apache_server_htaccess_path }}"
|
dest: "{{ apache_server_htaccess_path }}"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: Confguring htpasswd
|
- name: Confguring htpasswd
|
||||||
become: true
|
become: yes
|
||||||
block:
|
block:
|
||||||
- name: Ensure needed packages
|
- name: Ensure needed packages
|
||||||
apt:
|
apt:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
- name: redhat | ensuring apache packages are present
|
- name: redhat | ensuring apache packages are present
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
||||||
yum:
|
yum:
|
||||||
name:
|
name:
|
||||||
@ -21,7 +21,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: ubuntu | ensuring apache packages are present
|
- name: ubuntu | ensuring apache packages are present
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
@ -30,25 +30,25 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Disable default virtual host
|
- name: Disable default virtual host
|
||||||
become: true
|
become: yes
|
||||||
command: a2dissite 000-default
|
command: a2dissite 000-default
|
||||||
|
|
||||||
- name: Enable ssl module
|
- name: Enable ssl module
|
||||||
become: true
|
become: yes
|
||||||
command: a2enmod headers ssl
|
command: a2enmod headers ssl
|
||||||
|
|
||||||
- name: Add ssl configuration
|
- name: Add ssl configuration
|
||||||
become: true
|
become: yes
|
||||||
template:
|
template:
|
||||||
src: ssl-params.conf.j2
|
src: ssl-params.conf.j2
|
||||||
dest: /etc/apache2/conf-available/ssl-params.conf
|
dest: /etc/apache2/conf-available/ssl-params.conf
|
||||||
|
|
||||||
- name: Enable ssl configuration
|
- name: Enable ssl configuration
|
||||||
become: true
|
become: yes
|
||||||
command: a2enconf ssl-params
|
command: a2enconf ssl-params
|
||||||
|
|
||||||
- name: redhat | enabling apache on boot and starting
|
- name: redhat | enabling apache on boot and starting
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
||||||
service:
|
service:
|
||||||
name: httpd
|
name: httpd
|
||||||
@ -56,7 +56,7 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Reload apache2 service
|
- name: Reload apache2 service
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||||
service:
|
service:
|
||||||
name: apache2
|
name: apache2
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Reload apache2 service
|
- name: Reload apache2 service
|
||||||
become: true
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: apache2
|
name: apache2
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Generating ssl key & certificate
|
- name: Generating ssl key & certificate
|
||||||
become: true
|
become: yes
|
||||||
block:
|
block:
|
||||||
- name: Ensure needed packages
|
- name: Ensure needed packages
|
||||||
apt:
|
apt:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
msg: "Only Debian|Ubuntu are currently supported"
|
msg: "Only Debian|Ubuntu are currently supported"
|
||||||
|
|
||||||
- name: Preparing wsgi module for sushy-emulator
|
- name: Preparing wsgi module for sushy-emulator
|
||||||
become: true
|
become: yes
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Ensure Apache
|
- name: Ensure Apache
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
msg: "Only Debian|Ubuntu are currently supported"
|
msg: "Only Debian|Ubuntu are currently supported"
|
||||||
|
|
||||||
- name: Confguring sushy-emulator frontend
|
- name: Confguring sushy-emulator frontend
|
||||||
become: true
|
become: yes
|
||||||
block:
|
block:
|
||||||
- name: Ensure sushy-emulator backend
|
- name: Ensure sushy-emulator backend
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
- name: Ensuring docker and support packages are present
|
- name: Ensuring docker and support packages are present
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
||||||
yum:
|
yum:
|
||||||
name:
|
name:
|
||||||
@ -22,7 +22,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensuring docker and support packages are present
|
- name: Ensuring docker and support packages are present
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
@ -37,7 +37,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Add user "{{ ansible_user }}" to docker group
|
- name: Add user "{{ ansible_user }}" to docker group
|
||||||
become: true
|
become: yes
|
||||||
user:
|
user:
|
||||||
name: "{{ ansible_user }}"
|
name: "{{ ansible_user }}"
|
||||||
groups:
|
groups:
|
||||||
@ -60,23 +60,23 @@
|
|||||||
src: http-proxy-conf.j2
|
src: http-proxy-conf.j2
|
||||||
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||||
when: proxy.enabled|bool == true
|
when: proxy.enabled|bool == true
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: Create docker directory
|
- name: Create docker directory
|
||||||
file:
|
file:
|
||||||
path: "{{ docker_config_path }}"
|
path: "{{ docker_config_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: Save docker daemon configuration
|
- name: Save docker daemon configuration
|
||||||
copy:
|
copy:
|
||||||
content: "{{ docker_config | to_nice_json }}"
|
content: "{{ docker_config | to_nice_json }}"
|
||||||
dest: "{{ docker_config_path }}/daemon.json"
|
dest: "{{ docker_config_path }}/daemon.json"
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
- name: Start docker
|
- name: Start docker
|
||||||
become: true
|
become: yes
|
||||||
systemd:
|
systemd:
|
||||||
name: docker
|
name: docker
|
||||||
state: restarted
|
state: restarted
|
||||||
@ -84,7 +84,7 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Change group ownership on docker sock
|
- name: Change group ownership on docker sock
|
||||||
become: true
|
become: yes
|
||||||
file:
|
file:
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
group: docker
|
group: docker
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
- name: Load the kvm kernel module
|
- name: Load the kvm kernel module
|
||||||
modprobe:
|
modprobe:
|
||||||
name: kvm
|
name: kvm
|
||||||
become: true
|
become: yes
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Check for the KVM device
|
- name: Check for the KVM device
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
recurse: true
|
recurse: true
|
||||||
mode: 0770
|
mode: 0770
|
||||||
become: true
|
become: yes
|
||||||
when: "libvirt_domain.console_log_enabled | default(false)"
|
when: "libvirt_domain.console_log_enabled | default(false)"
|
||||||
|
|
||||||
- name: Validate VM interfaces
|
- name: Validate VM interfaces
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: configure libvirt
|
- name: configure libvirt
|
||||||
become: true
|
become: yes
|
||||||
block:
|
block:
|
||||||
- name: Set libvirt security driver
|
- name: Set libvirt security driver
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
- name: Ensuring Libvirt, Qemu and support packages are present
|
- name: Ensuring Libvirt, Qemu and support packages are present
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
||||||
yum:
|
yum:
|
||||||
name:
|
name:
|
||||||
@ -24,7 +24,7 @@
|
|||||||
- qemu-kvm
|
- qemu-kvm
|
||||||
state: present
|
state: present
|
||||||
- name: Ensuring Libvirt, Qemu and support packages are present
|
- name: Ensuring Libvirt, Qemu and support packages are present
|
||||||
become: true
|
become: yes
|
||||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
@ -38,7 +38,7 @@
|
|||||||
- ebtables
|
- ebtables
|
||||||
state: present
|
state: present
|
||||||
- name: Add user "{{ ansible_user }}" to libvirt group
|
- name: Add user "{{ ansible_user }}" to libvirt group
|
||||||
become: true
|
become: yes
|
||||||
user:
|
user:
|
||||||
name: "{{ ansible_user }}"
|
name: "{{ ansible_user }}"
|
||||||
groups:
|
groups:
|
||||||
@ -52,5 +52,5 @@
|
|||||||
name: libvirtd
|
name: libvirtd
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
become: true
|
become: yes
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
name:
|
name:
|
||||||
- bridge-utils
|
- bridge-utils
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: yes
|
||||||
- name: gather network info
|
- name: gather network info
|
||||||
virt_net:
|
virt_net:
|
||||||
command: info
|
command: info
|
||||||
@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
- name: Create virtual ethernet interface
|
- name: Create virtual ethernet interface
|
||||||
command: ip link add name air02 type veth peer name air01
|
command: ip link add name air02 type veth peer name air01
|
||||||
become: true
|
become: yes
|
||||||
changed_when:
|
changed_when:
|
||||||
- "create_veth_command.rc != 2"
|
- "create_veth_command.rc != 2"
|
||||||
- "'RTNETLINK answers: File exists' not in (create_veth_command.stderr | default(''))"
|
- "'RTNETLINK answers: File exists' not in (create_veth_command.stderr | default(''))"
|
||||||
@ -103,14 +103,14 @@
|
|||||||
- "create_veth_command.rc != 0"
|
- "create_veth_command.rc != 0"
|
||||||
- "'RTNETLINK answers: File exists' not in (create_veth_command.stderr | default(''))"
|
- "'RTNETLINK answers: File exists' not in (create_veth_command.stderr | default(''))"
|
||||||
- name: set interface up
|
- name: set interface up
|
||||||
become: true
|
become: yes
|
||||||
command: ip link set up dev air02
|
command: ip link set up dev air02
|
||||||
# This makes task never report to be changed, it is a workaround
|
# This makes task never report to be changed, it is a workaround
|
||||||
# because if device is already up there is no command output or different RC
|
# because if device is already up there is no command output or different RC
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: set interface up
|
- name: set interface up
|
||||||
become: true
|
become: yes
|
||||||
command: ip link set up dev air01
|
command: ip link set up dev air01
|
||||||
# This makes task never report to be changed, it is a workaround
|
# This makes task never report to be changed, it is a workaround
|
||||||
# because if device is already up there is no command output or different RC
|
# because if device is already up there is no command output or different RC
|
||||||
@ -121,7 +121,7 @@
|
|||||||
already_in_bridge: device air02 is already a member of a bridge; can't enslave it to bridge oob-net.
|
already_in_bridge: device air02 is already a member of a bridge; can't enslave it to bridge oob-net.
|
||||||
|
|
||||||
- name: Add interface to libvirt managed linux bridge with dhcp
|
- name: Add interface to libvirt managed linux bridge with dhcp
|
||||||
become: true
|
become: yes
|
||||||
command: brctl addif oob-net air02
|
command: brctl addif oob-net air02
|
||||||
changed_when:
|
changed_when:
|
||||||
- add_if_command.rc != 1
|
- add_if_command.rc != 1
|
||||||
@ -132,7 +132,7 @@
|
|||||||
register: add_if_command
|
register: add_if_command
|
||||||
|
|
||||||
- name: send dhcp request over the interface
|
- name: send dhcp request over the interface
|
||||||
become: true
|
become: yes
|
||||||
command: timeout 20s dhclient air01
|
command: timeout 20s dhclient air01
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user