-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomandi-utili.txt
40 lines (27 loc) · 1.27 KB
/
comandi-utili.txt
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
# ===============
# RUN MODULE
# ===============
# run module local, target via hosts file
ansible -i ./hosts --connection=local local -m MODULE -e 'host_key_checking=False'
# run module, target via hosts file
ansible -i ./hosts LABEL -m MODULE -e 'host_key_checking=False' --private-key=/home/user/.ssh/key -e 'ansible_ssh_user=remoteuser'
# run module remote, target via ip list
ansible -i 'host1,' all -m MODULE -e 'host_key_checking=False' --private-key=/home/user/.ssh/key -e 'ansible_ssh_user=remoteuser'
# ===============
# RUN PLAYBOOK
# ===============
# run playbook local, target via hosts file
ansible-playbook -i ./hosts --connection=local PLAYBOOK -e 'host_key_checking=False'
# run playbook, target via hosts file
ansible-playbook -i ./hosts playbook.yml -e 'host_key_checking=False' --private-key=/home/user/.ssh/key -e 'ansible_ssh_user=remoteuser'
# run playbook, target via ip list
ansible-playbook -i 'host1,' playbook.yml -e 'host_key_checking=False' --private-key=/home/user/.ssh/key -e 'ansible_ssh_user=remoteuser'
# ===============
# OPTIONS
# ===============
# SSH RSA private key
--private-key=/home/user/.ssh/key
# remote user to connect via SSH
-e 'ansible_ssh_user=remoteuser'
# extra vars to parametrize playbook/role
--extra-vars "VAR1=val1 VAR2=val2"