mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-11 17:24:29 +02:00
test markdown
This commit is contained in:
@@ -10,7 +10,7 @@ filename: LearnAnsible.txt
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
"{{ Why Ansible and Intro }}" in the second part of document
|
"{{ Why Ansible and detailed Intro }}" written in the second part of document
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -60,19 +60,19 @@ Example of modules:
|
|||||||
Example of execution - `ping`, `shell`
|
Example of execution - `ping`, `shell`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ansible -m ping
|
$ ansible -m ping all
|
||||||
$ ansible -m shell -a 'date; whoami' localhost #hostname_or_a_group_name
|
$ ansible -m shell -a 'date; whoami' localhost #hostname_or_a_group_name
|
||||||
```
|
```
|
||||||
|
|
||||||
* Module: `command` - executes a single command that will not be processed through the shell, so variables like $HOME or operands like `|` `;` will not work
|
* Module: `command` - executes a single command that will not be processed through the shell, so variables like $HOME or operands like `|` `;` will not work
|
||||||
|
#JM
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ansible -m command -a 'date; whoami' # FAILURE
|
$ ansible -m command -a 'date; whoami' # FAILURE
|
||||||
|
|
||||||
$ ansible -m command -a 'date'
|
$ ansible -m command -a 'date' all
|
||||||
$ ansible -m command -a 'whoami'
|
$ ansible -m command -a 'whoami' all
|
||||||
$ ansible -m command -a 'echo $HOME'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Module: `file` - performs file operations (stat, link, dir, ...)
|
* Module: `file` - performs file operations (stat, link, dir, ...)
|
||||||
@@ -92,6 +92,11 @@ localhost
|
|||||||
[some_group]
|
[some_group]
|
||||||
hostA.mydomain.com
|
hostA.mydomain.com
|
||||||
hostB.localdomain
|
hostB.localdomain
|
||||||
|
|
||||||
|
[a_group_of_a_groups:children]
|
||||||
|
some_group
|
||||||
|
some_other_group
|
||||||
|
|
||||||
```
|
```
|
||||||
* [Additional Reading.](http://docs.ansible.com/ansible/latest/intro_inventory.html)
|
* [Additional Reading.](http://docs.ansible.com/ansible/latest/intro_inventory.html)
|
||||||
|
|
||||||
@@ -104,7 +109,7 @@ hostB.localdomain
|
|||||||
|
|
||||||
|
|
||||||
### Playbook
|
### Playbook
|
||||||
Execution plan written in a form of script file(s) is called `playbook`.
|
**Execution plan** written in a form of script file(s) is called `playbook`.
|
||||||
Playbook consist of multiple elements
|
Playbook consist of multiple elements
|
||||||
* a list (or group) of hosts that 'the play' is executed against
|
* a list (or group) of hosts that 'the play' is executed against
|
||||||
* `task(s)` or `role(s)` that are going to be executed
|
* `task(s)` or `role(s)` that are going to be executed
|
||||||
|
Reference in New Issue
Block a user