mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Rename 'ensure' to 'state' because I think it's a bit cleaner and doesn't imply
all modules take a common parameter name. But more or less we still work idempotently in modules.
This commit is contained in:
parent
228d1a0834
commit
ba4e36a9a9
10 changed files with 45 additions and 72 deletions
|
@ -1,7 +1,7 @@
|
|||
'\" t
|
||||
.\" Title: ansible-modules
|
||||
.\" Author: [see the "AUTHOR" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
||||
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
||||
.\" Date: 02/26/2012
|
||||
.\" Manual: System administration commands
|
||||
.\" Source: Ansible-modules 0.0.1
|
||||
|
@ -9,15 +9,6 @@
|
|||
.\"
|
||||
.TH "ANSIBLE\-MODULES" "5" "02/26/2012" "Ansible\-modules 0\&.0\&.1" "System administration commands"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
|
@ -101,7 +92,7 @@ This module is informative only \- it takes no parameters & does not support cha
|
|||
.sp
|
||||
Controls services on remote machines\&.
|
||||
.PP
|
||||
\fBensure=\fR
|
||||
\fBstate=\fR
|
||||
.RS 4
|
||||
Values are
|
||||
\fIstarted\fR,
|
||||
|
|
|
@ -121,7 +121,7 @@ service
|
|||
|
||||
Controls services on remote machines.
|
||||
|
||||
*ensure=*::
|
||||
*state=*::
|
||||
|
||||
Values are 'started', 'stopped', or 'restarted'. Started/stopped
|
||||
are idempotent actions that will not run commands unless neccessary.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'\" t
|
||||
.\" Title: ansible-modules
|
||||
.\" Author: [see the "AUTHOR" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
||||
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
||||
.\" Date: 02/26/2012
|
||||
.\" Manual: System administration commands
|
||||
.\" Source: Ansible-playbook 0.0.1
|
||||
|
@ -9,15 +9,6 @@
|
|||
.\"
|
||||
.TH "ANSIBLE\-MODULES" "5" "02/26/2012" "Ansible\-playbook 0\&.0\&.1" "System administration commands"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
|
@ -37,29 +28,27 @@ Ansible ships with a ansible\-playbook tool for running playbooks\&. Playbooks c
|
|||
Playbooks are currently writeable in YAML\&. Other formats (JSON?) may be supported in the future\&.
|
||||
.SH "EXAMPLE"
|
||||
.sp
|
||||
FIXME: verify this is correct below
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
\-\-\-
|
||||
\- pattern: \*(Aq*\*(Aq
|
||||
hosts: \*(Aq/etc/ansible/hosts\*(Aq
|
||||
\- pattern: \'*\'
|
||||
hosts: \'/etc/ansible/hosts\'
|
||||
tasks:
|
||||
\- do:
|
||||
\- configure template & module variables for future template calls
|
||||
\- setup http_port=80 max_clients=200
|
||||
\- do:
|
||||
\- write the apache config file
|
||||
\- template src=/srv/mytemplates/httpd\&.j2 dest=/etc/httpd/conf
|
||||
\- name:configure template & module variables for future template calls
|
||||
action: setup http_port=80 max_clients=200
|
||||
\- name: write the apache config file
|
||||
action: template src=/srv/mytemplates/httpd\&.j2 dest=/etc/httpd/conf
|
||||
notify:
|
||||
\- restart apache
|
||||
\- do
|
||||
\- ensure apache is running
|
||||
\- service name=httpd ensure=started
|
||||
\- name: ensure apache is running
|
||||
action: service name=httpd ensure=started
|
||||
handlers:
|
||||
\- do:
|
||||
\- restart apache
|
||||
\- service name=httpd ensure=restarted
|
||||
\- name: restart apache
|
||||
\- action: service name=httpd ensure=restarted
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
|
@ -81,9 +70,7 @@ Playbooks are executed top down and can contain multiple references to patterns\
|
|||
.sp
|
||||
For each pattern, the tasks in the \fItasks\fR list are executed in order for all hosts in the host file matching the pattern\&.
|
||||
.sp
|
||||
For each task, a "do" statement describes what the task is and what ansible module to use to accomplish the task, along with any arguments\&. The first line in the "do" is the name of the task \(em this will appear in any log output\&.
|
||||
.sp
|
||||
The second line in each "do" is the module name followed by module arguments\&.
|
||||
For each task, a name/action pair describes what the task is and what ansible module to use to accomplish the task, along with any arguments\&. Additional fields like \fIcomment:\fR can be added and will be ignored\&.
|
||||
.sp
|
||||
Most modules accept key=value format arguments\&.
|
||||
.sp
|
||||
|
|
|
@ -29,26 +29,24 @@ be supported in the future.
|
|||
EXAMPLE
|
||||
-------
|
||||
|
||||
FIXME: verify this is correct below
|
||||
|
||||
[literal]
|
||||
---
|
||||
- pattern: '*'
|
||||
hosts: '/etc/ansible/hosts'
|
||||
tasks:
|
||||
- do:
|
||||
- configure template & module variables for future template calls
|
||||
- setup http_port=80 max_clients=200
|
||||
- do:
|
||||
- write the apache config file
|
||||
- template src=/srv/mytemplates/httpd.j2 dest=/etc/httpd/conf
|
||||
- name:configure template & module variables for future template calls
|
||||
action: setup http_port=80 max_clients=200
|
||||
- name: write the apache config file
|
||||
action: template src=/srv/mytemplates/httpd.j2 dest=/etc/httpd/conf
|
||||
notify:
|
||||
- restart apache
|
||||
- do
|
||||
- ensure apache is running
|
||||
- service name=httpd ensure=started
|
||||
- name: ensure apache is running
|
||||
action: service name=httpd ensure=started
|
||||
handlers:
|
||||
- do:
|
||||
- restart apache
|
||||
- service name=httpd ensure=restarted
|
||||
- name: restart apache
|
||||
- action: service name=httpd ensure=restarted
|
||||
|
||||
|
||||
WHAT THE EXAMPLE MEANS
|
||||
|
@ -82,13 +80,10 @@ something different to all webservers again.
|
|||
For each pattern, the tasks in the 'tasks' list are executed in order
|
||||
for all hosts in the host file matching the pattern.
|
||||
|
||||
For each task, a "do" statement describes what the task is and what
|
||||
For each task, a name/action pair describes what the task is and what
|
||||
ansible module to use to accomplish the task, along with any
|
||||
arguments. The first line in the "do" is the name of the task -- this
|
||||
will appear in any log output.
|
||||
|
||||
The second line in each "do" is the module name followed by module
|
||||
arguments.
|
||||
arguments. Additional fields like 'comment:' can be added and will
|
||||
be ignored.
|
||||
|
||||
Most modules accept key=value format arguments.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue