読者です 読者をやめる 読者になる 読者になる

MBP(はてな)

MacBook Pro,iPhone 6s,Moto360,Nexus7

Ansible

Ansible チュートリアル | Ansible Tutorial in Japanese

$ ansible localhost -m ping

$ ansible localhost -a 'uname -r'

$ angible-doc ping

$ ansible-playbook -i hosts simple-playbook.yml --syntax-check
$ ansible-playbook -i hosts simple-playbook.yml --sy でもOK

$ ansible-playbook -i hosts simple-playbook.yml --list-tasks

$ cat <<_EOD_ > hosts
[t]
localhost
_EOD_

simple-playbook.yml
hosts: become: no
tasks:
name: test connection
ping:

sshを使わずlocalで実行。[Ansible] sshで繋がずにlocalhostで実行する - Qiita

$ ansible-playbook -i hosts simple-playbook.yml --check --connection=local

ローカルの情報を取得する
$ ansible -m setup -i hosts localhost --connection=local

実行時にデータを収取しない。実行時間短縮
gather_facts: no

ansible-playbooks/main.yml at master · hnakamur/ansible-playbooks · GitHub
name: download checkinstall source
git: >
repo=http://checkinstall.izto.org/checkinstall.git
dest=/usr/local/src/checkinstall
update=no

hosts: localhost
connection: local
become: no
gather_facts: no
Ansible for Enterprise // Speaker Deck