test-playbook works
This commit is contained in:
parent
89b4d69f27
commit
efe0052016
28
README
28
README
|
@ -6,10 +6,30 @@
|
||||||
|
|
||||||
Ansible playbooks of the University of Waterloo Computer Science Club.
|
Ansible playbooks of the University of Waterloo Computer Science Club.
|
||||||
|
|
||||||
** Usage **
|
** 2022 Playbook Modernization **
|
||||||
To run a playbook and request a user's ssh/sudo password:
|
If a playbook is not in this list, it is not guaranteed to work.
|
||||||
|
- [x] test-playbook.yml
|
||||||
|
|
||||||
`ansible-playbook -kK -b test-playbook.yml`
|
** Deps **
|
||||||
|
1. Install pipx
|
||||||
|
```
|
||||||
|
sudo apt install python3-pip python3-venv
|
||||||
|
python3 -m pip install --user pipx
|
||||||
|
python3 -m pipx ensurepath
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install ansible and ansible-lint
|
||||||
|
```
|
||||||
|
pipx install --include-deps ansible
|
||||||
|
pipx install ansible-lint
|
||||||
|
```
|
||||||
|
|
||||||
|
** Usage **
|
||||||
|
To run a playbook and request a user's sudo password:
|
||||||
|
|
||||||
|
`ansible-playbook test-playbook.yml`
|
||||||
|
|
||||||
|
** OLD **
|
||||||
|
|
||||||
To run a playbook as a different user (for example to provision a new system
|
To run a playbook as a different user (for example to provision a new system
|
||||||
that doesn't have sssd yet):
|
that doesn't have sssd yet):
|
||||||
|
@ -18,4 +38,4 @@ that doesn't have sssd yet):
|
||||||
|
|
||||||
To run a playbook starting at a certain spot:
|
To run a playbook starting at a certain spot:
|
||||||
|
|
||||||
`ansible-playbook -kK -b install-office-terminal.yml --start-at-task='enable magic sysrq'`
|
`ansible-playbook -kK -b install-office-terminal.yml --start-at-task='enable magic sysrq'`
|
||||||
|
|
|
@ -13,8 +13,10 @@ log_path = ansible.log
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
|
|
||||||
callback_plugins = plugins/callback/log_plays/
|
#callback_plugins = plugins/callback/log_plays/
|
||||||
|
|
||||||
[ssh_connection]
|
[ssh_connection]
|
||||||
#ssh_args = -o ServerAliveInterval=30 -o ControlMaster=no
|
#ssh_args = -o ServerAliveInterval=30 -o ControlMaster=no
|
||||||
|
|
||||||
|
[privilege_escalation]
|
||||||
|
become_ask_pass= True
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
---
|
---
|
||||||
- hosts: all
|
- name: Test become
|
||||||
become: yes
|
hosts: all
|
||||||
tasks:
|
become: true
|
||||||
- name: whoami
|
tasks:
|
||||||
command: whoami
|
- name: Run whoami
|
||||||
|
ansible.builtin.command: whoami
|
||||||
|
register: result
|
||||||
|
when: true # keep the linter happy
|
||||||
|
|
||||||
|
- name: Print result
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: result.stdout
|
||||||
|
|
Loading…
Reference in New Issue