Use test_become flag in Tobiko ansible roles
Change-Id: Ic8b6895b0bdab441b6aec0a6c8007252bfaaa5f0
This commit is contained in:
parent
3eadbe21f9
commit
3aa27f1beb
@ -1,4 +1,5 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: tobiko-ensure-python3
|
||||
- tobiko-common
|
||||
- tobiko-ensure-python3
|
||||
|
@ -27,7 +27,7 @@
|
||||
failed_when: yes
|
||||
|
||||
- name: 'install missing packages'
|
||||
become: yes
|
||||
become: '{{ test_become | bool }}'
|
||||
package:
|
||||
name: '{{ run_bindep.stdout_lines }}'
|
||||
register: install_packages
|
||||
|
4
roles/tobiko-ensure-git/meta/main.yaml
Normal file
4
roles/tobiko-ensure-git/meta/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: tobiko-common
|
@ -4,17 +4,19 @@
|
||||
- name: "get '{{ git_executable }}' full path"
|
||||
shell: >
|
||||
which '{{ git_executable }}'
|
||||
changed_when: no
|
||||
register: get_git_path
|
||||
|
||||
rescue:
|
||||
- name: "install Git packages"
|
||||
become: true
|
||||
- name: "install Git package"
|
||||
become: '{{ test_become | bool }}'
|
||||
package:
|
||||
name: git
|
||||
|
||||
- name: "get '{{ git_executable }}' full path"
|
||||
shell: >
|
||||
which '{{ git_executable }}'
|
||||
changed_when: no
|
||||
register: get_git_path
|
||||
|
||||
|
||||
@ -26,6 +28,7 @@
|
||||
- name: "get Git version"
|
||||
command: >
|
||||
'{{ git_executable }}' --version
|
||||
changed_when: no
|
||||
register:
|
||||
get_git_version
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: "install '{{ python_command }}' packages"
|
||||
become: true
|
||||
become: '{{ test_become | bool }}'
|
||||
package:
|
||||
name: "{{ python_packages[python_command] | flatten }}"
|
||||
when: 'python_command in python_packages'
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
rescue:
|
||||
- name: "try setting python alternative to '{{ python_alternative }}'"
|
||||
become: true
|
||||
become: '{{ test_become | bool }}'
|
||||
command: "alternatives --set python '{{ python_alternative }}'"
|
||||
ignore_errors: yes
|
||||
when: 'python_alternative is defined'
|
||||
|
4
roles/tobiko-ensure-rsync/meta/main.yaml
Normal file
4
roles/tobiko-ensure-rsync/meta/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: tobiko-common
|
@ -4,17 +4,19 @@
|
||||
- name: "get '{{ rsync_executable }}' full path"
|
||||
shell: >
|
||||
which '{{ rsync_executable }}'
|
||||
changed_when: no
|
||||
register: get_rsync_path
|
||||
|
||||
rescue:
|
||||
- name: "install Rsync packages"
|
||||
become: true
|
||||
become: '{{ test_become | bool }}'
|
||||
package:
|
||||
name: rsync
|
||||
|
||||
- name: "get '{{ rsync_executable }}' full path"
|
||||
shell: >
|
||||
which '{{ rsync_executable }}'
|
||||
changed_when: no
|
||||
register: get_rsync_path
|
||||
|
||||
|
||||
@ -26,6 +28,7 @@
|
||||
- name: "get Rsync version"
|
||||
command: >
|
||||
'{{ rsync_executable }}' --version
|
||||
changed_when: no
|
||||
register:
|
||||
get_rsync_version
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
block:
|
||||
- name: "get remote username"
|
||||
command: whoami
|
||||
changed_when: false
|
||||
become: false
|
||||
changed_when: no
|
||||
become: no
|
||||
register: get_inventory_user
|
||||
|
||||
- name: "set test_inventory_user fact"
|
||||
|
Loading…
Reference in New Issue
Block a user