HOSTNAME ou $HOSTNAME ? suppression ambiguïté
This commit is contained in:
parent
93c628afc6
commit
2630e9dbc7
|
@ -47,7 +47,7 @@ ssh_args = -o ControlMaster=auto -o ControlPersist=300s
|
||||||
pipelining = True
|
pipelining = True
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
Exemples d'utilisation basique :
|
Exemples d'utilisation basique sur sa machine en local :
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
$ ansible localhost -m ping
|
$ ansible localhost -m ping
|
||||||
|
@ -55,14 +55,18 @@ localhost | SUCCESS => {
|
||||||
"changed": false,
|
"changed": false,
|
||||||
"ping": "pong"
|
"ping": "pong"
|
||||||
}
|
}
|
||||||
|
~~~
|
||||||
|
|
||||||
$ echo HOSTNAME >> ~/.ansible/hosts
|
Ou sur une machine distante :
|
||||||
$ ssh-copy-id HOSTNAME
|
|
||||||
$ ansible HOSTNAME -i $HOME/.ansible/hosts -m ping --one-line --forks 1
|
|
||||||
HOSTNAME | SUCCESS => {"changed": false, "ping": "pong"}
|
|
||||||
|
|
||||||
$ ansible "HOST*" -m command --args "date"
|
~~~
|
||||||
HOSTNAME | SUCCESS | rc=0 >>
|
$ echo mon-serveur >> ~/.ansible/hosts
|
||||||
|
$ ssh-copy-id mon-serveur
|
||||||
|
$ ansible mon-serveur -i $HOME/.ansible/hosts -m ping --one-line --forks 1
|
||||||
|
mon-serveur | SUCCESS => {"changed": false, "ping": "pong"}
|
||||||
|
|
||||||
|
$ ansible "mon-*" -m command --args "date"
|
||||||
|
mon-serveur | SUCCESS | rc=0 >>
|
||||||
jeudi 26 mai 2016, 23:16:01 (UTC+0200)
|
jeudi 26 mai 2016, 23:16:01 (UTC+0200)
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue