Skip to content

Commit 922cf64

Browse files
ianf77KylaF8
authored andcommitted
CQA changes for getting Started with playbooks (ansible#5070)
CQA checks: Getting Started with Playbooks https://issues.redhat.com/browse/AAP-58656
1 parent 656aa97 commit 922cf64

16 files changed

+67
-40
lines changed

downstream/assemblies/playbooks/assembly-intro-to-playbooks.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
= Introduction
66

7+
[ role="_abstract"]
78
An Ansible Playbook is a blueprint for automation tasks, which are actions executed with limited manual effort across an inventory of solutions.
89
Playbooks tell Ansible what to do on which devices.
9-
Instead of manually applying the same action to hundreds or thousands of similar technologies across IT environments, executing a playbook automatically completes the same action for the specified type of inventory—such as a set of routers.
1010

11-
Playbooks are regularly used to automate IT infrastructure—such as operating systems and Kubernetes platforms—networks, security systems, and code repositories like GitHub.
12-
You can use playbooks to program applications, services, server nodes, and other devices, without the manual overhead of creating everything from scratch.
11+
Instead of manually applying the same action to many similar technologies across IT environments, executing a playbook automatically completes the same action for the specified type of inventory, such as a set of routers.
12+
13+
Playbooks are regularly used to automate IT infrastructure, such as operating systems, Kubernetes platforms, networks, security systems, and code repositories such as GitHub.
14+
15+
You can use playbooks to program applications, services, server nodes, and other devices, without the effort of creating everything from scratch.
1316
Playbooks, and the conditions, variables, and tasks within them, can be saved, shared, or reused indefinitely.
1417
This makes it easier for you to codify operational knowledge and ensure that the same actions are performed consistently.
1518

downstream/assemblies/playbooks/assembly-networking-playbook.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
[id="assembly-networking-playbook"]
44

5-
= Use a Playbook to establish a connection to a managed node
5+
= Use a playbook to establish a connection to a managed node
6+
7+
[role="_abstract"]
8+
Learn how to create and run a simple Ansible Playbook that connects to a network device, gathers facts, and displays them.
69

710
To confirm your credentials, you can connect to a network device manually and retrieve its configuration. Replace the sample user and device name with your real credentials.
811

downstream/assemblies/playbooks/assembly-playbook-practical-example.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
= A practical example of an Ansible Playbook
66

7+
[role="_abstract"]
78
Ansible can communicate with many different device classifications, from cloud-based REST APIs, to Linux and Windows systems, networking hardware, and much more.
8-
99
The following is a sample of two Ansible modules automatically updating two types of servers.
1010

1111
include::playbooks/ref-playbook-execution.adoc[leveloffset=+1]

downstream/modules/playbooks/proc-build-an-inventory.adoc

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,35 @@
44

55
= Building an inventory
66

7+
[role="_abstract"]
78
Inventories organize managed nodes in centralized files that provide Ansible with system information and network locations. Using an inventory file, Ansible can manage a large number of hosts with a single command.
8-
To complete the following steps, you need the IP address or fully qualified domain name (FQDN) of at least one host system. For demonstration purposes, the host could be running locally in a container or a virtual machine.
99

10-
You must also ensure that your public SSH key is added to the `authorized_keys` file on each host.
10+
.Prerequisites
11+
* To complete the following steps, you need the IP address or fully qualified domain name (FQDN) of at least one host system. For demonstration purposes, the host could be running locally in a container or a virtual machine.
12+
* You must also ensure that your public SSH key is added to the `authorized_keys` file on each host.
1113
Use the following procedure to build an inventory.
1214

1315
.Procedure
14-
Create a file named `inventory.ini` in the `ansible_quickstart` directory that you created.
15-
Add a new `[myhosts]` group to the inventory.ini file and specify the IP address or fully qualified domain name (FQDN) of each host system.
16-
16+
. Create a file named `inventory.ini` in the `ansible_quickstart` directory that you created.
17+
. Add a new `[myhosts]` group to the inventory.ini file and specify the IP address or fully qualified domain name (FQDN) of each host system.
18+
+
1719
----
1820
[myhosts]
1921
192.0.2.50
2022
192.0.2.51
2123
192.0.2.52
2224
----
2325

24-
Verify your inventory, using:
25-
26+
. Verify your inventory, using:
27+
+
2628
`ansible-inventory -i inventory.ini --list`
2729

28-
Ping the `myhosts` group in your inventory, using:
29-
30+
. Ping the `myhosts` group in your inventory, using:
31+
+
3032
'ansible myhosts -m ping -i inventory.ini`
31-
33+
+
3234
Pass the `-u` option with the Ansible command if the username is different on the control node and the managed node(s).
33-
35+
+
3436
----
3537
192.0.2.50 | SUCCESS => {
3638
"ansible_facts": {
@@ -54,6 +56,6 @@ Pass the `-u` option with the Ansible command if the username is different on th
5456
"ping": "pong"
5557
}
5658
----
57-
59+
+
5860
You have successfully built an inventory.
5961

downstream/modules/playbooks/proc-creating-a-playbook.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
= Creating your first playbook
66

7-
Use the following procedure to create a playbook that pings your hosts and prints a “Hello world” message.
7+
[role="_abstract"]
8+
Learn how to create a playbook that pings your hosts and prints a “Hello world” message.
89

910
.Procedure
1011
. Create a file named `playbook.yaml` in your `ansible_quickstart` directory, with the following content:
@@ -54,7 +55,7 @@ PLAY RECAP *********************************************************************
5455
192.0.2.51: ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
5556
192.0.2.52: ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
5657
----
57-
58+
+
5859
In this output you can see:
5960

6061
* The names that you give the play and each task.

downstream/modules/playbooks/proc-run-ansible-network-playbook.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
= Running a network Ansible Playbook
66

7+
[role="_abstract"]
78
If you want to run a particular command every day, you can save it in a playbook and run it with `ansible-playbook` instead of ansible.
9+
810
The playbook can store many of the parameters you provided with flags at the command line, leaving less to type at the command line.
911
You need two files for this, a playbook and an inventory file.
1012

@@ -49,7 +51,7 @@ When facts are gathered from a system, either through a collection-specific fact
4951

5052
When a module runs in a playbook, the output is held in memory for use by future tasks instead of written to the console. With most other modules you must explicitly register a variable to store and reuse the output of a module or task.
5153

52-
For more information about facts, see [Ansible facts] in the _Ansiible Playbook Reference Guide_.
54+
//For more information about facts, see [Ansible facts] in the _Ansible Playbook Reference Guide_.
5355

5456
The following debug task lets you see the results in your shell.
5557

@@ -58,7 +60,7 @@ The following debug task lets you see the results in your shell.
5860
+
5961
`ansible-playbook -i vyos.example.net, -u ansible -k -e ansible_network_os=vyos.vyos.vyos first_playbook.yml`
6062
+
61-
The playbook contains one play with two tasks, and generates output like this.
63+
The playbook contains one play with two tasks, and generates output similar to the following:
6264
+
6365
----
6466
$ ansible-playbook -i vyos.example.net, -u ansible -k -e ansible_network_os=vyos.vyos.vyos first_playbook.yml

downstream/modules/playbooks/proc-starting-automation.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44

55
= Starting automation with Ansible
66

7+
[role="_abstract"]
78
Get started with Ansible by creating an automation project, building an inventory, and creating a `Hello World` playbook.
89

910
.Prerequisites
1011
* The Ansible package must be installed.
11-
12+
* A text editor must be available to create and edit files.
1213

1314
.Procedure
1415

1516
* Create a project folder on your filesystem.
16-
17+
+
1718
----
1819
mkdir ansible_quickstart
1920
cd ansible_quickstart
2021
----
21-
22+
+
2223
Using a single directory structure makes it easier to add to source control, and reuse and share automation content.

downstream/modules/playbooks/ref-create-variables.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
= Create variables
66

7+
[role="_abstract"]
78
Variables set values for managed nodes, such as the IP address, FQDN, operating system, and SSH user, so you do not need to pass them when running Ansible commands.
89

910
Variables can apply to specific hosts.

downstream/modules/playbooks/ref-how-do-playbooks-work.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
[id="ref-how-do-playbooks-work"]
44

5-
= How do Ansible Playbooks work?
5+
= How do Ansible Playbooks work
66

7-
Ansible Playbooks are lists of tasks that automatically execute for your specified inventory or groups of hosts.
7+
[role="_abstract"]
8+
Ansible Playbooks are lists of tasks that run automatically for your specified inventory or groups of hosts.
89
One or more Ansible tasks can be combined to make a play, that is, an ordered grouping of tasks mapped to specific hosts.
910

1011
Tasks are executed in the order in which they are written.
@@ -32,7 +33,7 @@ A unit of code or binary that Ansible runs on managed nodes.
3233

3334
Ansible modules are grouped in collections with a _Fully Qualified Collection Name_ (FQCN) for each module.
3435
Tasks are executed by modules, each of which performs a specific task in a playbook.
35-
A module contains metadata that determines when and where a task is executed, as well as which user executes it.
36+
A module contains metadata that determines when and where a task is executed, and which user executes it.
3637
There are thousands of Ansible modules that perform all kinds of IT tasks, such as:
3738

3839
* Cloud management

downstream/modules/playbooks/ref-how-to-use-ansible-playbooks.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
[id="ref-how-to-use-ansible-playbooks"]
44

5-
= How do I use Ansible Playbooks?
5+
= How do I use Ansible Playbooks
66

7-
Ansible uses the YAML syntax.
8-
YAML is a human-readable language that enables you to create playbooks without having to learn a complicated coding language.
7+
[role="_abstract"]
8+
Ansible Playbooks are files containing a series of instructions that define the required state of a system or application.
9+
They are written in YAML, a human-readable data serialization format, and are used to automate IT tasks such as configuration management, application deployment, and orchestration.
10+
11+
You can use YAML to create playbooks without having to learn a complicated coding language.
912
//Commenting out as no downstream alternative [AAP-57435]
1013
//For more information on YAML, see YAML Syntax and consider installing an add-on for your text editor, see link:https://docs.ansible.com/ansible/latest/community/other_tools_and_programs.html#other-tools-and-programs[Other Tools and Programs] to help you write clean YAML syntax in your playbooks.
1114

0 commit comments

Comments
 (0)