-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible-playbook.cheat
45 lines (30 loc) · 1.44 KB
/
ansible-playbook.cheat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% ansible-playbook
# Run a playbook
ansible-playbook <playbook_name>
# Run a playbook with a custom inventory
ansible-playbook <playbook_name> -i <inventory_file>
# Run a playbook but connect as a different user
ansible-playbook <playbook_name> -u <user>
# Run a playbook using a custom SSH key
ansible-playbook <playbook_name> --private-key=<path_to_private_key>
# Authenticate with a password before running a playbook
ansible-playbook <playbook_name> --ask-pass
# Provide sudo password.
ansible-playbook <playbook_name> --ask-become-pass
# List all tasks that will be executed by a play without making any changes
ansible-playbook <playbook_name> --list-tasks
# List all the hosts that will be affected by a play without running any tasks
ansible-playbook <playbook_name> --list-hosts
# List all available tags in a play without running any tasks
ansible-playbook <playbook_name> --list-tags
# Skip all tasks prior to the defined one
ansible-playbook <playbook_name> --start-at-tasks=<task_name>
# Only execute given tagged tasks
ansible-playbook <playbook_name> --tags=<tags>
# Skip given tagged tasks
ansible-playbook <playbook_name> --skip-tags=<tags>
# Make the playbook output more verbose
ansible-playbook <playbook_name> -v
# Make the playbook output extremely verbose
ansible-playbook <playbook_name> -vvv
$ playbook_name: find . -maxdepth 1 -path ./.cache -prune -false -o \( -name '*.yml' -o -name '*.yaml' \) -and ! -name 'requirements.yml'