From 87ab7d76afc9e121dbfbee17d981ae94cfd0de65 Mon Sep 17 00:00:00 2001
From: Michael DeHaan
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
The user module allows easy creation and manipulation of existing user accounts, as well +as removal of user accounts that may exist:
+ansible all -m user -a "name=foo password=<crypted password here>"
+
+ansible all -m user -a "name=foo state=absent"
+See the Ansible Modules section for details on all of the available options.
+Deploy your webapp straight from git:
@@ -318,7 +329,7 @@ a simplified syntax for this.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
ansible-playbook — run an ansible playbook
Ansible playbooks are a configuration and multinode deployment system. Ansible-playbook is the tool +
ansible-playbook — run an ansible playbook
Ansible playbooks are a configuration and multinode deployment system. Ansible-playbook is the tool used to run them. See the project home page (link below) for more information.
ansible — run a command somewhere else
Ansible is an extra-simple tool/framework/API for doing 'remote things' over +
ansible — run a command somewhere else
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
If you want to run a command through the shell (say you are using ‘<’, ‘>’, ‘|’, etc), you actually want the ‘shell’ module instead. The ‘command’ module is much more secure as it’s not affected by the user’s environment.
-Example usage:
-/sbin/shutdown -t now
-The given command will be executed on all selected nodes. It will not be processed through the shell, so variables like “$HOME” and operations like “<”, “>”, “|”, and “&” will not work. As such, all @@ -212,6 +210,9 @@ paths to commands must be fully qualified.
This module does not support change hooks and returns the return code from the program as well as timing information about how long the command was running for.
+Example action from a playbook:
+command /sbin/shutdown -t now
+This module also returns md5sum information about the resultant file.
+Example action from a playbook:
+copy src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644
+Example action from a playbook:
+file dest=/etc/foo.conf owner=foo group=foo mode=0644
+file dest=/some/path owner=foo group=foo state=directory
+file dest/path/to/delete state=absent
+Example action from a playbook:
+git repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22
+Example action from a playbook:
+service name=httpd state=started
+service name=httpd state=stopped
+service name=httpd state=restarted
+Example action from a playbook:
+vars:
+ ntpserver: 'ntp.example.com'
+ xyz: 1234
+Example action from /usr/bin/ansible:
+ansible -m all setup -a "ntpserver=ntp.example.com xyz=1234"
+The shell module takes the command name followed by a list of arguments, space delimited. It is almost exactly like the command module but runs the command through the shell rather than directly.
-Example usage:
-find . | grep *.txt
-The given command will be executed on all selected nodes.
If you want to execute a command securely and predicably, it may be better to use the ‘command’ module instead. Best practices @@ -349,6 +371,9 @@ use your best judgement.
This module does not support change hooks and returns the return code from the program as well as timing information about how long the command was running for.
+Example action from a playbook:
+shell somescript.sh >> somelog.txt
+This module also returns md5sum information about the resultant file.
+Example action from a playbook:
+template src=/srv/mytemplates/foo.j2 dest=/etc/foo.conf owner=foo group=foo mode=0644
+Creates user accounts, manipulates existing user accounts, and removes user accounts.
+name:
+comment:
+gid:
+shell:
+createhome:
+password:
+state:
+Example action from a playbook:
+user name=mdehaan comment=awesome passwd=awWxVV.JvmdHw createhome=yes
+user name=mdehaan state=absent
+Will install, upgrade, remove, and list packages with the yum package manager.
pkg:
Example action from a playbook:
+yum pkg=httpd ensure=latest
+yum pkg=httpd ensure=removed
+yum pkg=httpd ensure=installed
+
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
vars:
+ favcolor: blue
is_favcolor_blue: "'$favcolor' == 'blue'"
is_centos: "'$facter_operatingsystem' == 'CentOS'"
tasks:
@@ -621,7 +622,7 @@ Let’s run a playbook using a parallelism level of 10:
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.
© Copyright 2012 Michael DeHaan.
- Last updated on Mar 21, 2012.
+ Last updated on Mar 22, 2012.
Created using Sphinx 1.0.8.