test-playbook works

This commit is contained in:
Edwin Zhang 2022-07-31 03:35:07 -04:00
parent 89b4d69f27
commit efe0052016
3 changed files with 39 additions and 10 deletions

View File

@ -6,10 +6,30 @@
Ansible playbooks of the University of Waterloo Computer Science Club.
** Usage **
To run a playbook and request a user's ssh/sudo password:
** 2022 Playbook Modernization **
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
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:
`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'`

View File

@ -13,8 +13,10 @@ log_path = ansible.log
# Plugins
callback_plugins = plugins/callback/log_plays/
#callback_plugins = plugins/callback/log_plays/
#ssh_args = -o ServerAliveInterval=30 -o ControlMaster=no
become_ask_pass= True

View File

@ -1,6 +1,13 @@
- hosts: all
become: yes
- name: whoami
command: whoami
- name: Test become
hosts: all
become: true
- name: Run whoami
ansible.builtin.command: whoami
register: result
when: true # keep the linter happy
- name: Print result
var: result.stdout