From d36ef6809c9edc62df6c2933b0d589219d4ad2c0 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 19 Jun 2025 12:28:14 +0530 Subject: [PATCH 01/28] creates structure --- DC-Ansible | 16 ++++ articles/ansible.asm.xml | 138 +++++++++++++++++++++++++++++ concepts/ansible-intro.xml | 26 ++++++ references/ansible-basic-usage.xml | 26 ++++++ references/ansible-configure.xml | 26 ++++++ tasks/ansible-install.xml | 26 ++++++ 6 files changed, 258 insertions(+) create mode 100644 DC-Ansible create mode 100644 articles/ansible.asm.xml create mode 100644 concepts/ansible-intro.xml create mode 100644 references/ansible-basic-usage.xml create mode 100644 references/ansible-configure.xml create mode 100644 tasks/ansible-install.xml diff --git a/DC-Ansible b/DC-Ansible new file mode 100644 index 000000000..0e6717697 --- /dev/null +++ b/DC-Ansible @@ -0,0 +1,16 @@ +# This file originates from the project https://github.com/openSUSE/doc-kit +# This file can be edited downstream. + +MAIN="ansible.asm.xml" +# Point to the ID of the of your assembly +SRC_DIR="articles" +IMG_SRC_DIR="images" + +PROFOS="sles" +PROFCONDITION="16.0" +STRUCTID="ansible" +#PROFCONDITION="suse-product;beta" +#PROFCONDITION="community-project" + +STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2022-ns" +FALLBACK_STYLEROOT="/usr/share/xml/docbook/stylesheet/suse-ns" \ No newline at end of file diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml new file mode 100644 index 000000000..69938f780 --- /dev/null +++ b/articles/ansible.asm.xml @@ -0,0 +1,138 @@ + + + + %entities; +]> + + + + + + + + + + + + + + Ansible automation platform + + 2025-06-19 + + + Initial version + + + + + + + + + + Smart Docs + + + + Administration + Configuration + Security + + + + + + https://bugzilla.suse.com/enter_bug.cgi + Documentation + SUSE Linux Enterprise Server 16.0 + amrita.sakthivel@suse.com + + yes + + + + + &x86-64; + &power; + &zseries; + &aarch64; + + + + + &sles; + + + + Ansible automation platform + Learn how to automate IT tasks using Ansible + + + Save time by using Ansible automation platform. + + + + + WHAT? + + + + + + + + WHY? + + + + + + + + EFFORT + + + + + + + + REQUIREMENTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/concepts/ansible-intro.xml b/concepts/ansible-intro.xml new file mode 100644 index 000000000..a1e5240d2 --- /dev/null +++ b/concepts/ansible-intro.xml @@ -0,0 +1,26 @@ + + + + + %entities; +]> + + + Introduction to Ansible automation platform + + + + + + + + + \ No newline at end of file diff --git a/references/ansible-basic-usage.xml b/references/ansible-basic-usage.xml new file mode 100644 index 000000000..1c1bc5ebc --- /dev/null +++ b/references/ansible-basic-usage.xml @@ -0,0 +1,26 @@ + + + + + %entities; +]> + + + Basic usage of Ansible + + + + + + + + + \ No newline at end of file diff --git a/references/ansible-configure.xml b/references/ansible-configure.xml new file mode 100644 index 000000000..7542eaf76 --- /dev/null +++ b/references/ansible-configure.xml @@ -0,0 +1,26 @@ + + + + + %entities; +]> + + + Understanding Ansible configuration + + + + + + + + + \ No newline at end of file diff --git a/tasks/ansible-install.xml b/tasks/ansible-install.xml new file mode 100644 index 000000000..551c2d6ca --- /dev/null +++ b/tasks/ansible-install.xml @@ -0,0 +1,26 @@ + + + + + %entities; +]> + + + Installing Ansible + + + + + + + + + \ No newline at end of file From d66e286c60dfe65e8956834aba03f9c87007697e Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 19 Jun 2025 12:33:44 +0530 Subject: [PATCH 02/28] validation issues --- articles/ansible.asm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index 69938f780..727114d78 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -124,7 +124,7 @@ - + From ed92526cc37fa25b9d0cd0d69748eaa64196db83 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 19 Jun 2025 12:40:46 +0530 Subject: [PATCH 03/28] validation --- articles/ansible.asm.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index 727114d78..ce1bd9226 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -13,11 +13,11 @@ xmlns="http://docbook.org/ns/docbook"> - - - - - + + + + + From c2a2b2a4b16de66e15b17c1342f613b73c1ad8e9 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 19 Jun 2025 14:04:15 +0530 Subject: [PATCH 04/28] intro content --- concepts/ansible-intro.xml | 41 +++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/concepts/ansible-intro.xml b/concepts/ansible-intro.xml index a1e5240d2..13ab826f0 100644 --- a/concepts/ansible-intro.xml +++ b/concepts/ansible-intro.xml @@ -18,9 +18,44 @@ - - + Ansible is an open-source IT automation engine that automates provisioning, configuration management, application deployment and other IT processes. + It is simple and has agent less architecture, which means it doesn't require any special software installed on the machines it manages. + It operates on the following concepts: - + + + + + Control node: The machine where Ansible is installed and executed. + + + + Managed Nodes: The target servers or devices that Ansible manages. + + + + + Inventory: A file that defines and groups your managed nodes. + + + + + Modules: Small programs that Ansible pushes to managed nodes to perform specific tasks. + + + + + Tasks: A single action executed by a module. + + + + Playbooks: YAML files that contain an ordered list of tasks and define the desired state of your systems. + + + + Roles: Structured ways to organize playbooks and other related files for reusability. + + + \ No newline at end of file From 68d87e7e4c2c650c21c8af1b92736f40080d1ea6 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 19 Jun 2025 14:07:50 +0530 Subject: [PATCH 05/28] validation --- concepts/ansible-intro.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/concepts/ansible-intro.xml b/concepts/ansible-intro.xml index 13ab826f0..b4b5ec946 100644 --- a/concepts/ansible-intro.xml +++ b/concepts/ansible-intro.xml @@ -23,8 +23,7 @@ It operates on the following concepts: - - + Control node: The machine where Ansible is installed and executed. @@ -47,14 +46,17 @@ Tasks: A single action executed by a module. + Playbooks: YAML files that contain an ordered list of tasks and define the desired state of your systems. - + + Roles: Structured ways to organize playbooks and other related files for reusability. + From bc291099344a4b4bee1c3d26334d22ef87894388 Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 20 Jun 2025 12:37:39 +0530 Subject: [PATCH 06/28] configure ansible --- references/ansible-configure.xml | 37 ++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/references/ansible-configure.xml b/references/ansible-configure.xml index 7542eaf76..866020e84 100644 --- a/references/ansible-configure.xml +++ b/references/ansible-configure.xml @@ -18,9 +18,38 @@ - +Use the ansible.cfg file to adjust certain settings. The standard configuration is usually sufficient +for most users. Ansible's behavior can also be configured in environment variables, command-line options and playbook keywords. - + - - \ No newline at end of file + The ansible-config utility provides users with a comprehensive view of all available configuration settings, including their default values, + instructions on how to set them, and the origin of their current values. Ansible processes the following list and uses the first file found, all others are ignored. + + + + + ANSIBLE_CONFIG environment variable if set. + + + + + ansible.cfg located in the current directory. + + + + + ~/.ansible.cfg located in the home directory. + + + + + /etc/ansible/ansible.cfg + + + + You can generate a sample ansible.cfg file either with a fully commented out file or + more complete file that includes existing plugin. For example: + &prompt.user; ansible-config init --disabled > ansible.cfg + &prompt.user; ansible-config init --disabled -t all > ansible.cfg + \ No newline at end of file From adb4d818dbc019174af0db3f77be468fac817f3e Mon Sep 17 00:00:00 2001 From: Amrita Date: Wed, 30 Jul 2025 15:29:23 +0530 Subject: [PATCH 07/28] roles --- articles/ansible.asm.xml | 1 + concepts/ansible-linux-roles.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 concepts/ansible-linux-roles.xml diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index ce1bd9226..c5653bcd1 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -15,6 +15,7 @@ + diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml new file mode 100644 index 000000000..98891b866 --- /dev/null +++ b/concepts/ansible-linux-roles.xml @@ -0,0 +1,28 @@ + + + + + %entities; +]> + + + Introduction to Ansible automation platform + + + + Ansible is an open-source IT automation engine that automates provisioning, configuration management, application deployment and other IT processes. + It is simple and has agent less architecture, which means it doesn't require any special software installed on the machines it manages. + It operates on the following concepts: + + + + + \ No newline at end of file From 7d23a10aeec10eeda6cb007bde9f1775cca922bb Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 31 Jul 2025 16:59:11 +0530 Subject: [PATCH 08/28] validate --- articles/ansible.asm.xml | 1 + concepts/ansible-linux-roles.xml | 64 ++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 7 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index c5653bcd1..008e128cb 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -126,6 +126,7 @@ + diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml index 98891b866..a49a0590b 100644 --- a/concepts/ansible-linux-roles.xml +++ b/concepts/ansible-linux-roles.xml @@ -14,15 +14,65 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Introduction to Ansible automation platform + Linux system roles - - Ansible is an open-source IT automation engine that automates provisioning, configuration management, application deployment and other IT processes. - It is simple and has agent less architecture, which means it doesn't require any special software installed on the machines it manages. - It operates on the following concepts: - + +Linux system roles are a set of &ansible; roles designed to automate and configure common components and services of the Linux operating system. +Linux System Roles are typically used with &ansible; playbooks. You define the desired state of your systems in an &ansible; playbook, specifying which roles to apply +and with what parameters. &ansible; then connects to your Linux hosts and executes the tasks defined within the roles to bring your systems into the desired state. + + - + The following system roles are supported on &productname;: +
+ &suseconnect; + This &ansible; role is used to manage SUSE Linux system registrations with &scc; or a ⪪ server. + It automates the process of registering and deregistering systems, as well as managing additional products and modules on a SUSE system. + + This role includes: + + + + Registration of a SUSE system to &scc; or ⪪. + + + + + Activation or removal of specific add-on products or modules. + + + + + De registration of systems or products + + + + + Pre-check tasks to ensure a smooth registration process. + + + + When using this role, make sure you have a valid registration key for your SUSE products, + through your SUSE subscription. +
+ Role variables + The following variables can be configured in this role: + + + + + +
+
+ Role examples + Some examples include + + + + + +
+
\ No newline at end of file From e98be5ac3fee551162757bc2c3e3657aa2cc42cb Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 1 Aug 2025 15:30:09 +0530 Subject: [PATCH 09/28] adds var --- concepts/ansible-linux-roles.xml | 116 +++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 6 deletions(-) diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml index a49a0590b..cb67501fd 100644 --- a/concepts/ansible-linux-roles.xml +++ b/concepts/ansible-linux-roles.xml @@ -44,7 +44,7 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut - De registration of systems or products + Deregistration of systems or products @@ -60,19 +60,123 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut The following variables can be configured in this role: - - + Thesuseconnect_base_product variable is of type:dict. + It defines the base product that should be activated on the target system. The dictionary includes the following + keys: + + + Bonding and teaming feature comparison + + + + + + + +Key + Type + Description + Required + + + + + product + string + Internal product name +No + + + key + string + Registration key for the product +Yes + + + version + string + Version of the product to be activated, default is the base OS version +No + + + arch + string + Architecture of the product, default is the to the OS architecture ansible_machine +No + + + email + string + Email address used for &scc; registration +No + + + +
+
Role examples - Some examples include + Some examples include: - + This example registers a &productname; system and activates several modules. + + - name: Register with SCC and activate modules + hosts: all + vars: + suseconnect_base_product: + key: '{{ sles_registration_key }}' + product: '{{ ansible_distribution }}' + + suseconnect_subscriptions: + - {name: "sle-module-containers", state: enabled} + - {name: "PackageHub", state: disabled} + - {name: "sle-module-python3", state: enabled} + + tasks: + - name: Register system and modules with SUSE Customer Center + ansible.builtin.include_role: + name: suseconnect + + + This example adds or removes modules and extensions and also registers and de-registers + components as well as enables or disables their repositories. + + + - name: Adding or deleting modules and extensions + hosts: all + vars: + suseconnect_subscriptions: + - {name: "sle-module-containers", state: enabled} + - {name: "PackageHub", state: disabled} + - {name: "sle-module-python3", state: enabled} + - {name: "sle-ha", state: enabled, key: "REGISTRATION-KEY"} + + tasks: + - name: Remove other subscriptions + ansible.builtin.include_role: + name: suseconnect + + + + This example shows how to de-register base products that are no longer required. + + + - name: Deregister products from SCC + hosts: all + vars: + suseconnect_deregister: true + + tasks: + - name: Deregister products from SUSE Customer Center + ansible.builtin.include_role: + name: suseconnect + +
- \ No newline at end of file From 70c93b5c71bc6b9026eb13f567f5ac3f7eb532c5 Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 1 Aug 2025 15:49:16 +0530 Subject: [PATCH 10/28] adds to table --- concepts/ansible-linux-roles.xml | 70 ++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml index cb67501fd..10c07f79e 100644 --- a/concepts/ansible-linux-roles.xml +++ b/concepts/ansible-linux-roles.xml @@ -65,7 +65,7 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut keys: - Bonding and teaming feature comparison + <literal>suseconnect_base_product</literal>keys @@ -73,7 +73,7 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut -Key + Key Type Description Required @@ -95,13 +95,13 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut version string - Version of the product to be activated, default is the base OS version + Version of the product to be activated, default is the base OS version ansible_distribution_version No arch string - Architecture of the product, default is the to the OS architecture ansible_machine + Architecture of the product, default is the OS architecture ansible_machine No @@ -113,6 +113,68 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut
+ + + Thesuseconnect_subscriptions variable is of type:list. + It defines the list of additional modules or products to be added or removed on the target system. + The dictionary includes the following keys: + + +<literal>suseconnect_subscriptions</literal>keys + + + + + + + +Key +Type +Description +Required + + + + +name +string +Internal product name +Yes + + +state +string +The state of the subscription, which is either enabled or disabled. + If not specified, the default state is enabled. +No + + +version +string +Version of the product to be activated, default is the base OS version ansible_distribution_version +No + + +arch +string +Architecture of the product, default is the OS architecture ansible_machine +No + + +email +string +Email address used for &scc; registration +No + + + key + string + Registration key for the product +Yes + + + +
From a0a78e82ca3c59f5d70be040c49cec86c9fac92b Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 1 Aug 2025 15:53:05 +0530 Subject: [PATCH 11/28] validate --- concepts/ansible-linux-roles.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml index 10c07f79e..d4446b522 100644 --- a/concepts/ansible-linux-roles.xml +++ b/concepts/ansible-linux-roles.xml @@ -119,7 +119,7 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut It defines the list of additional modules or products to be added or removed on the target system. The dictionary includes the following keys: - +
<literal>suseconnect_subscriptions</literal>keys From b86ef9ee97519293604c9f0be13b99dafee2d637 Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 1 Aug 2025 16:06:43 +0530 Subject: [PATCH 12/28] adds to table --- concepts/ansible-linux-roles.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml index d4446b522..4175edb65 100644 --- a/concepts/ansible-linux-roles.xml +++ b/concepts/ansible-linux-roles.xml @@ -117,7 +117,7 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut Thesuseconnect_subscriptions variable is of type:list. It defines the list of additional modules or products to be added or removed on the target system. - The dictionary includes the following keys: + Each item in the dictionary has the following keys:
<literal>suseconnect_subscriptions</literal>keys @@ -176,7 +176,11 @@ and with what parameters. &ansible; then connects to your Linux hosts and execut
- +Thesuseconnect_reregister variable is of type:bool. + It defines whether to force re-registration of base product, regardless of current status default: false. + Thesuseconnect_deregister variable is of type:bool. + It defines whether to whether to deregister the system, regardless of current status default: false. +
Role examples From 160ba301d0d2576f4b42c2384748f40333f3ed82 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 21 Aug 2025 10:46:47 +0530 Subject: [PATCH 13/28] adds topics to TOC --- articles/ansible.asm.xml | 8 +- concepts/ansible-intro.xml | 2 +- concepts/ansible-inventory-file.xml | 26 +++ concepts/ansible-linux-roles.xml | 248 -------------------------- references/ansible-best-practices.xml | 30 ++++ tasks/Ansible-playbook.xml | 26 +++ 6 files changed, 88 insertions(+), 252 deletions(-) create mode 100644 concepts/ansible-inventory-file.xml delete mode 100644 concepts/ansible-linux-roles.xml create mode 100644 references/ansible-best-practices.xml create mode 100644 tasks/Ansible-playbook.xml diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index 008e128cb..3b9f8e7b2 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -126,12 +126,14 @@ - - + - + + + + diff --git a/concepts/ansible-intro.xml b/concepts/ansible-intro.xml index b4b5ec946..8afb5c3c4 100644 --- a/concepts/ansible-intro.xml +++ b/concepts/ansible-intro.xml @@ -14,7 +14,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Introduction to Ansible automation platform + Introduction to Ansible core diff --git a/concepts/ansible-inventory-file.xml b/concepts/ansible-inventory-file.xml new file mode 100644 index 000000000..987981a08 --- /dev/null +++ b/concepts/ansible-inventory-file.xml @@ -0,0 +1,26 @@ + + + + + %entities; +]> + + + Structure of the inventory file + + + + + + + + + \ No newline at end of file diff --git a/concepts/ansible-linux-roles.xml b/concepts/ansible-linux-roles.xml deleted file mode 100644 index 4175edb65..000000000 --- a/concepts/ansible-linux-roles.xml +++ /dev/null @@ -1,248 +0,0 @@ - - - - - %entities; -]> - - - Linux system roles - - - -Linux system roles are a set of &ansible; roles designed to automate and configure common components and services of the Linux operating system. -Linux System Roles are typically used with &ansible; playbooks. You define the desired state of your systems in an &ansible; playbook, specifying which roles to apply -and with what parameters. &ansible; then connects to your Linux hosts and executes the tasks defined within the roles to bring your systems into the desired state. - - - - The following system roles are supported on &productname;: -
- &suseconnect; - This &ansible; role is used to manage SUSE Linux system registrations with &scc; or a ⪪ server. - It automates the process of registering and deregistering systems, as well as managing additional products and modules on a SUSE system. - - This role includes: - - - - Registration of a SUSE system to &scc; or ⪪. - - - - - Activation or removal of specific add-on products or modules. - - - - - Deregistration of systems or products - - - - - Pre-check tasks to ensure a smooth registration process. - - - - When using this role, make sure you have a valid registration key for your SUSE products, - through your SUSE subscription. -
- Role variables - The following variables can be configured in this role: - - - Thesuseconnect_base_product variable is of type:dict. - It defines the base product that should be activated on the target system. The dictionary includes the following - keys: - - - <literal>suseconnect_base_product</literal>keys - - - - - - - - Key - Type - Description - Required - - - - - product - string - Internal product name -No - - - key - string - Registration key for the product -Yes - - - version - string - Version of the product to be activated, default is the base OS version ansible_distribution_version -No - - - arch - string - Architecture of the product, default is the OS architecture ansible_machine -No - - - email - string - Email address used for &scc; registration -No - - - -
-
- - Thesuseconnect_subscriptions variable is of type:list. - It defines the list of additional modules or products to be added or removed on the target system. - Each item in the dictionary has the following keys: - - -<literal>suseconnect_subscriptions</literal>keys - - - - - - - -Key -Type -Description -Required - - - - -name -string -Internal product name -Yes - - -state -string -The state of the subscription, which is either enabled or disabled. - If not specified, the default state is enabled. -No - - -version -string -Version of the product to be activated, default is the base OS version ansible_distribution_version -No - - -arch -string -Architecture of the product, default is the OS architecture ansible_machine -No - - -email -string -Email address used for &scc; registration -No - - - key - string - Registration key for the product -Yes - - - -
-
-Thesuseconnect_reregister variable is of type:bool. - It defines whether to force re-registration of base product, regardless of current status default: false. - Thesuseconnect_deregister variable is of type:bool. - It defines whether to whether to deregister the system, regardless of current status default: false. -
-
-
- Role examples - Some examples include: - - - This example registers a &productname; system and activates several modules. - - - name: Register with SCC and activate modules - hosts: all - vars: - suseconnect_base_product: - key: '{{ sles_registration_key }}' - product: '{{ ansible_distribution }}' - - suseconnect_subscriptions: - - {name: "sle-module-containers", state: enabled} - - {name: "PackageHub", state: disabled} - - {name: "sle-module-python3", state: enabled} - - tasks: - - name: Register system and modules with SUSE Customer Center - ansible.builtin.include_role: - name: suseconnect - - - - This example adds or removes modules and extensions and also registers and de-registers - components as well as enables or disables their repositories. - - - - name: Adding or deleting modules and extensions - hosts: all - vars: - suseconnect_subscriptions: - - {name: "sle-module-containers", state: enabled} - - {name: "PackageHub", state: disabled} - - {name: "sle-module-python3", state: enabled} - - {name: "sle-ha", state: enabled, key: "REGISTRATION-KEY"} - - tasks: - - name: Remove other subscriptions - ansible.builtin.include_role: - name: suseconnect - - - - This example shows how to de-register base products that are no longer required. - - - - name: Deregister products from SCC - hosts: all - vars: - suseconnect_deregister: true - - tasks: - - name: Deregister products from SUSE Customer Center - ansible.builtin.include_role: - name: suseconnect - - - -
-
-
\ No newline at end of file diff --git a/references/ansible-best-practices.xml b/references/ansible-best-practices.xml new file mode 100644 index 000000000..6cb96b681 --- /dev/null +++ b/references/ansible-best-practices.xml @@ -0,0 +1,30 @@ + + + %entities; +]> + + + + + + + &ansible; best practices + + + + + + + + + + diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml new file mode 100644 index 000000000..67eddbd15 --- /dev/null +++ b/tasks/Ansible-playbook.xml @@ -0,0 +1,26 @@ + + + + + %entities; +]> + + + Installing Ansible + + + + + + + + + \ No newline at end of file From 1dec11ab79d8d9d3d87a3eabd375a272f030c57b Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 21 Aug 2025 10:56:42 +0530 Subject: [PATCH 14/28] validation issues --- articles/ansible.asm.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index 3b9f8e7b2..bd6971763 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -15,9 +15,10 @@ - - - + + + + From 4d305451e34b535fe31300a78deb63708158c3e0 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 21 Aug 2025 11:06:04 +0530 Subject: [PATCH 15/28] validation --- concepts/ansible-inventory-file.xml | 13 ++++++------- references/ansible-best-practices.xml | 7 ++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/concepts/ansible-inventory-file.xml b/concepts/ansible-inventory-file.xml index 987981a08..21778e964 100644 --- a/concepts/ansible-inventory-file.xml +++ b/concepts/ansible-inventory-file.xml @@ -13,14 +13,13 @@ xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - - Structure of the inventory file + + &ansible; best practices - - + + - - - \ No newline at end of file + + diff --git a/references/ansible-best-practices.xml b/references/ansible-best-practices.xml index 6cb96b681..b06d99eee 100644 --- a/references/ansible-best-practices.xml +++ b/references/ansible-best-practices.xml @@ -8,7 +8,7 @@ -&ansible; best practices - - - + From 9a79218e58f94cbddc5560d1a6c7310aac5b1158 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 21 Aug 2025 11:12:45 +0530 Subject: [PATCH 16/28] issues --- concepts/ansible-inventory-file.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/concepts/ansible-inventory-file.xml b/concepts/ansible-inventory-file.xml index 21778e964..7ea72fc3b 100644 --- a/concepts/ansible-inventory-file.xml +++ b/concepts/ansible-inventory-file.xml @@ -1,11 +1,13 @@ - - %entities; ]> + + + + - - &ansible; best practices + + Structure of an inventory file From ddb0b32f5b9bdbc14f235b390701606c7755d27a Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 21 Aug 2025 11:16:44 +0530 Subject: [PATCH 17/28] validate --- articles/ansible.asm.xml | 2 +- concepts/ansible-inventory-file.xml | 4 ++-- references/ansible-best-practices.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index bd6971763..8cde80bbe 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -15,7 +15,7 @@ - + diff --git a/concepts/ansible-inventory-file.xml b/concepts/ansible-inventory-file.xml index 7ea72fc3b..186d7ee25 100644 --- a/concepts/ansible-inventory-file.xml +++ b/concepts/ansible-inventory-file.xml @@ -19,9 +19,9 @@ Structure of an inventory file - + xxx - + xxx diff --git a/references/ansible-best-practices.xml b/references/ansible-best-practices.xml index b06d99eee..a086c3bf5 100644 --- a/references/ansible-best-practices.xml +++ b/references/ansible-best-practices.xml @@ -19,9 +19,9 @@ &ansible; best practices - + xxxx
- + xxxx From 8d07c7c7281a3a1bbf51310385796c8570af0046 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 21 Aug 2025 12:19:55 +0530 Subject: [PATCH 18/28] issues --- articles/ansible.asm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index 8cde80bbe..e3782c673 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -25,7 +25,7 @@ - Ansible automation platform + Ansible core 2025-06-19 From 408301c385f1da4c71e7524e5bc910e122431b87 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 4 Sep 2025 14:52:21 +0530 Subject: [PATCH 19/28] invent-file --- concepts/ansible-intro.xml | 2 +- concepts/ansible-inventory-file.xml | 131 +++++++++++++++++++++++++++- tasks/Ansible-playbook.xml | 2 +- tasks/ansible-install.xml | 27 +++++- 4 files changed, 156 insertions(+), 6 deletions(-) diff --git a/concepts/ansible-intro.xml b/concepts/ansible-intro.xml index 8afb5c3c4..425520ebc 100644 --- a/concepts/ansible-intro.xml +++ b/concepts/ansible-intro.xml @@ -19,7 +19,7 @@ Ansible is an open-source IT automation engine that automates provisioning, configuration management, application deployment and other IT processes. - It is simple and has agent less architecture, which means it doesn't require any special software installed on the machines it manages. + It is simple and has agent less architecture, which means it does not require any special software installed on the machines it manages. It operates on the following concepts: diff --git a/concepts/ansible-inventory-file.xml b/concepts/ansible-inventory-file.xml index 186d7ee25..f99252ae8 100644 --- a/concepts/ansible-inventory-file.xml +++ b/concepts/ansible-inventory-file.xml @@ -19,9 +19,136 @@ Structure of an inventory file - xxx + + An &ansible; inventory file defines the hosts or servers on which &ansible; commands and playbooks will run. + It can be in either INI or YAML format and is a fundamental component of an Ansible project. - xxx + Ansible uses several built-in variables to connect to and manage hosts, which are often defined in the inventory file. + The most common ones are: + + ansible_host:Specifies the IP address or DNS name of the host. + + ansible_userThe user account to use for SSH connections. + + ansible_port:The path to the private key file for authentication. + + ansible_private_key_file:Specifies the IP address or DNS name of the host. + + ansible_python_interpreter:Specifies the path to the Python interpreter on the remote host if it is not the default. + + +
+ <literal>INI</literal>format + The INI format is the more traditional and widely used format for inventory files. + Hosts can be listed individually or grouped together. + + + Individual hosts + + You can either list the IP addresses or host names. For example: + host1.example.com + 192.168.1.50 + + + + Groups + + Groups are defined using [] brackets. You can apply tasks to multiple hosts simultaneously. + A host can belong to multiple groups. For example: + [webservers] + web1.example.com + web2.example.com + + [databases] + db1.example.com + + + + Group variables + + Variables can be assigned to all hosts within a specific group. + These are defined under the group name using a :vars suffix. For example: + [webservers:vars] + ansible_user=test + http_port=80 + + + + Child groups + + You can create a group of groups, known as a parent group, using the :children suffix. + This is useful for combining different host types for a single task. For example: + [all_servers:children] + webservers + databases + + + +
+
+ <literal>YAML</literal>format + YAML offers a structured and hierarchical way to represent the inventory. + It is often preferred for its readability and ability to handle complex data structures. + + + Host and group structure: + + The inventory is defined under the all keyword, which contains + hosts and children. For example, + all: + hosts: + host1.example.com: + 192.168.1.50: + children: + webservers: + hosts: + web1.example.com: + web2.example.com: + databases: + hosts: + db1.example.com: + + + + Group and host variables + + Variables are defined under a vars dictionary within the host or group. + For example: + [webservers] + web1.example.com + web2.example.com + + [databases] + db1.example.com + + + + Group variables + + Variables can be assigned to all hosts within a specific group. + These are defined under the group name using a :vars suffix. For example: + [webservers:vars] + ansible_user=test + http_port=80 + + + + Child groups + + You can create a group of groups, known as a parent group, using the :children suffix. + This is useful for combining different host types for a single task. For example: + all: + children: + webservers: + hosts: + web1.example.com: + ansible_user: test + vars: + http_port: 80 + + + +
diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml index 67eddbd15..5dea84ebd 100644 --- a/tasks/Ansible-playbook.xml +++ b/tasks/Ansible-playbook.xml @@ -14,7 +14,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Installing Ansible + Creating a playbook diff --git a/tasks/ansible-install.xml b/tasks/ansible-install.xml index 551c2d6ca..5359cda26 100644 --- a/tasks/ansible-install.xml +++ b/tasks/ansible-install.xml @@ -18,9 +18,32 @@ - +&ansible; is part of the base system on &productnameshort; &productnumber;. Additional modules are not required. - + + + + Refresh the repository and install &ansible; + &prompt.sudo;zypper refresh + &prompt.sudo;zypper install ansible + + + + To verify: + + &prompt.user;ansible --version + ansible [core 2.18.3] + config file = None + configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] + ansible python module location = /usr/lib/python3.13/site-packages/ansible + ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections + executable location = /bin/ansible + python version = 3.13.2 (main, Feb 09 2025, 18:58:59) [GCC] (/usr/bin/python3.13) + jinja version = 3.1.6 + libyaml = True + + + \ No newline at end of file From 34a66b38db7440c93228b60643c29b7e28795b35 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 4 Sep 2025 15:58:54 +0530 Subject: [PATCH 20/28] playbook --- articles/ansible.asm.xml | 3 +++ tasks/Ansible-playbook.xml | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index e3782c673..9054e20a5 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -17,6 +17,7 @@ + @@ -133,6 +134,8 @@
+ + diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml index 5dea84ebd..3d8ad9f64 100644 --- a/tasks/Ansible-playbook.xml +++ b/tasks/Ansible-playbook.xml @@ -18,9 +18,18 @@ - + An Ansible playbook is either a INI or YAML file that defines + a series of tasks to be executed on one or more hosts. This topic covers creating a simple playbook. - + + Set up SSH key-based authentication from the control node to each managed node. + Generate a key pair on the control node. + Copy the public key to the managed node. + + This one-time setup allows Ansible to connect securely without prompting for credentials during automation. + + Define an inventory file. In this example, the INIformat is used: + \ No newline at end of file From 2c32a000f2226d8b2dc996a84479b34bef190c4d Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 4 Sep 2025 17:57:26 +0530 Subject: [PATCH 21/28] playbook-steps --- tasks/Ansible-playbook.xml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml index 3d8ad9f64..c3d16b19d 100644 --- a/tasks/Ansible-playbook.xml +++ b/tasks/Ansible-playbook.xml @@ -18,18 +18,31 @@ - An Ansible playbook is either a INI or YAML file that defines - a series of tasks to be executed on one or more hosts. This topic covers creating a simple playbook. + An Ansible playbook is a YAML file that defines a series of tasks to be executed on one or more hosts. + This topic covers creating a simple playbook. Set up SSH key-based authentication from the control node to each managed node. - Generate a key pair on the control node. + Generate a key pair on the control node. + It is recommended to use a dedicated SSH key and clearly defined in the variable ansible_ssh_private_key_file. + Copy the public key to the managed node. This one-time setup allows Ansible to connect securely without prompting for credentials during automation. - Define an inventory file. In this example, the INIformat is used: + Define an inventory file. For example: + +Although Ansible uses etc/ansible/hosts/ by default, it is a + best practice to maintain a separate inventory file and specify it using the-i flag. + + Verify your inventory file, for example: + &prompt.user;ansible-inventory -i test.ini --list + + + Test the connection between the control node and managed nodes with the Ansible ad-hoc command: + &prompt.user;ansible all -i test.ini -m ping + \ No newline at end of file From 73da6934ecce50425c4d8d0e9a143215865d206f Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 5 Sep 2025 13:00:38 +0530 Subject: [PATCH 22/28] playbook-more --- tasks/Ansible-playbook.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml index c3d16b19d..2af5de037 100644 --- a/tasks/Ansible-playbook.xml +++ b/tasks/Ansible-playbook.xml @@ -43,6 +43,17 @@ Test the connection between the control node and managed nodes with the Ansible ad-hoc command: &prompt.user;ansible all -i test.ini -m ping + If the configuration is correct, the following message is displayed: + + This confirms Ansible can reach the managed nodes securely via SSH. + Playbooks are YAML files that define the tasks Ansible should perform. + For example, create a file named install.yml to define a task to install common packages on all managed &suse; systems: + + +Run the playbook: +ansible-playbook -i hosts.ini install.yml +Ansible connects to each host in your inventory and executes the defined tasks using the system’s package manager. + \ No newline at end of file From 0943a1cc65b271c7cdce93c99f38bf4559acdfbe Mon Sep 17 00:00:00 2001 From: Amrita Date: Fri, 5 Sep 2025 13:06:22 +0530 Subject: [PATCH 23/28] playbook-more-again --- tasks/Ansible-playbook.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml index 2af5de037..654337595 100644 --- a/tasks/Ansible-playbook.xml +++ b/tasks/Ansible-playbook.xml @@ -7,7 +7,7 @@ %entities; ]> Date: Wed, 10 Sep 2025 17:22:19 +0530 Subject: [PATCH 24/28] cli-tools --- references/ansible-basic-usage.xml | 153 ++++++++++++++++++++++++++++- tasks/Ansible-playbook.xml | 59 ----------- 2 files changed, 149 insertions(+), 63 deletions(-) delete mode 100644 tasks/Ansible-playbook.xml diff --git a/references/ansible-basic-usage.xml b/references/ansible-basic-usage.xml index 1c1bc5ebc..f54d02d45 100644 --- a/references/ansible-basic-usage.xml +++ b/references/ansible-basic-usage.xml @@ -18,9 +18,154 @@ - + Ansible provides ad-hoc commands and several utilities to perform various operation and automation + tasks. Ad-hoc commands in Ansible are useful for performing quick and one-off tasks that do not need to be saved for future use. + They are single line commands executed directly from the command line. Ad-hoc commands use the ansible CLI tool. - + In contrast, playbooks are a more powerful and scalable solution for defining complex, multi-step IT automation tasks. + They are written in YAML and contain a list of plays, with each play associating a group of hosts with a series of tasks. + The ansible-playbook CLI tool is used to execute these playbooks. This approach promotes reusability, version control, + and collaboration, making it the preferred method for managing and deploying applications at scale. + You can use either ad-hoc commands or create a playbook to automate your IT infrastructure based on your use case. + - - \ No newline at end of file + +
+ Ad-hoc commands + Ad-hoc commands are a quick way to run a single task on one or more managed hosts directly from the command. + Ideal for simple operations like checking system uptime or rebooting a server. + They are useful for quickly managing servers by performing actions like rebooting, copying files and managing packages and users. + You can use any of the available Ansible modules in an ad-hoc task. Like playbooks, ad-hoc tasks use a declarative + model, where you define the desired final state. Ansible then automatically calculates and executes the necessary steps to achieve that state. + This approach ensures the task can be run multiple times without causing unintended changes, as Ansible first checks the + current state of the host and only performs an action if it differs from the specified final state. +
+
+ Ansible command-line tools + + Ansible provides the following command-line tools: + + + ansible + + + A simple tool or framework for remote tasks; this command-line tool allows you to define and run a single task + playbook against a set of hosts. + &prompt.user;ansible -h + usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K | --become-password-file BECOME_PASSWORD_FILE] [-i INVENTORY] [--list-hosts] + [-l SUBSET] [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] + [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args SFTP_EXTRA_ARGS] [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args SSH_EXTRA_ARGS] [-k | + --connection-password-file CONNECTION_PASSWORD_FILE] [-C] [-D] [-e EXTRA_VARS] [--vault-id VAULT_IDS] [-J | --vault-password-file VAULT_PASSWORD_FILES] [-f FORKS] + [-M MODULE_PATH] [--playbook-dir BASEDIR] [--task-timeout TASK_TIMEOUT] [-a MODULE_ARGS] [-m MODULE_NAME] + pattern + Define and run a single task 'playbook' against a set of hosts + [...] + + + + + ansible-config + + + Used to manage and view Ansible's configuration settings. + &prompt.user;ansible-config -h + usage: ansible-config [-h] [--version] [-v] {list,dump,view,init,validate} ... + +View ansible configuration. + +positional arguments: + {list,dump,view,init,validate} + list Print all config options + dump Dump configuration + view View configuration file + init Create initial configuration + validate Validate the configuration file and environment variables. By default it only checks the base settings without accounting for plugins (see -t). + +options: + --version show program's version number, config file location, configured module search path, module location, executable location and exit + -h, --help show this help message and exit + -v, --verbose Causes Ansible to print more debug messages. Adding multiple -v will increase the verbosity, the builtin plugins currently evaluate up to -vvvvvv. A + reasonable level to start is -vvv, connection debugging might require -vvvv. This argument may be specified multiple times. + + + + ansible-console + + + An interactive command-line tool or Read-Eval-Print Loop (REPL), that lets you run Ansible ad-hoc commands in a persistent real-time shell environment. + It is a great tool for quickly testing modules, exploring your inventory and debugging issues without having to run a new command for every action. + + &prompt.user;ansible-console -h + usage: ansible-console [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K | --become-password-file BECOME_PASSWORD_FILE] [-i INVENTORY] + [--list-hosts] [-l SUBSET] [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] [--ssh-common-args SSH_COMMON_ARGS] + [--sftp-extra-args SFTP_EXTRA_ARGS] [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args SSH_EXTRA_ARGS] [-k | + --connection-password-file CONNECTION_PASSWORD_FILE] [-C] [-D] [--vault-id VAULT_IDS] [-J | --vault-password-file VAULT_PASSWORD_FILES] [-f FORKS] + [-M MODULE_PATH] [--playbook-dir BASEDIR] [-e EXTRA_VARS] [--task-timeout TASK_TIMEOUT] [--step] + [pattern] + +REPL console for executing Ansible tasks. + [...] + + + + + ansible-doc + + + A command-line tool that provides documentation for all Ansible's installed modules and plugins. + It is an essential utility for anyone writing playbooks or ad-hoc commands. You can look up a module's purpose, parameters, return , and even usage examples directly from your terminal. + + &prompt.user;ansible-doc -h + usage: ansible-doc [-h] [--version] [-v] [-M MODULE_PATH] [--playbook-dir BASEDIR] + [-t {become,cache,callback,cliconf,connection,httpapi,inventory,lookup,netconf,shell,vars,module,strategy,test,filter,role,keyword}] [-j] [-r ROLES_PATH] + [-e ENTRY_POINT | -s | -F | -l | --metadata-dump] [--no-fail-on-errors] + [plugin ...] + +plugin documentation tool + [...] + + + + +
+
+ Creating a playbook + + An Ansible playbook is a YAML file that defines a series of tasks to be executed on one or more hosts. + This topic covers creating a simple playbook. + + + Set up SSH key-based authentication from the control node to each managed node. + Generate a key pair on the control node. + It is recommended to use a dedicated SSH key and clearly defined in the variable ansible_ssh_private_key_file. + + Copy the public key to the managed node. + + This one-time setup allows Ansible to connect securely without prompting for credentials during automation. + + Define an inventory file. For example: + + Although Ansible uses etc/ansible/hosts/ by default, it is a + best practice to maintain a separate inventory file and specify it using the-i flag. + + Verify your inventory file, for example: + &prompt.user;ansible-inventory -i test.ini --list + + + Test the connection between the control node and managed nodes with the Ansible ad-hoc command: + &prompt.user;ansible all -i test.ini -m ping + If the configuration is correct, the following message is displayed: + + This confirms Ansible can reach the managed nodes securely via SSH. + + Playbooks are YAML files that define the tasks Ansible should perform. + For example, create a file named install.yml to define a task to install common packages on all managed &suse; systems: + + + Run the playbook: + ansible-playbook -i hosts.ini install.yml + Ansible connects to each host in your inventory and executes the defined tasks using the system’s package manager. + + +
+ \ No newline at end of file diff --git a/tasks/Ansible-playbook.xml b/tasks/Ansible-playbook.xml deleted file mode 100644 index 654337595..000000000 --- a/tasks/Ansible-playbook.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - %entities; -]> - - - Creating a playbook - - - - An Ansible playbook is a YAML file that defines a series of tasks to be executed on one or more hosts. - This topic covers creating a simple playbook. - - - - - Set up SSH key-based authentication from the control node to each managed node. - Generate a key pair on the control node. - It is recommended to use a dedicated SSH key and clearly defined in the variable ansible_ssh_private_key_file. - - Copy the public key to the managed node. - - This one-time setup allows Ansible to connect securely without prompting for credentials during automation. - - Define an inventory file. For example: - -Although Ansible uses etc/ansible/hosts/ by default, it is a - best practice to maintain a separate inventory file and specify it using the-i flag. - - Verify your inventory file, for example: - &prompt.user;ansible-inventory -i test.ini --list - - - Test the connection between the control node and managed nodes with the Ansible ad-hoc command: - &prompt.user;ansible all -i test.ini -m ping - If the configuration is correct, the following message is displayed: - - This confirms Ansible can reach the managed nodes securely via SSH. - - Playbooks are YAML files that define the tasks Ansible should perform. - For example, create a file named install.yml to define a task to install common packages on all managed &suse; systems: - - -Run the playbook: -ansible-playbook -i hosts.ini install.yml -Ansible connects to each host in your inventory and executes the defined tasks using the system’s package manager. - - - \ No newline at end of file From 62e86834effa77337eb3830b4c7bc43c32c86c89 Mon Sep 17 00:00:00 2001 From: Amrita Date: Thu, 11 Sep 2025 15:04:08 +0530 Subject: [PATCH 25/28] cli tool --- references/ansible-basic-usage.xml | 94 +++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/references/ansible-basic-usage.xml b/references/ansible-basic-usage.xml index f54d02d45..96be2dfec 100644 --- a/references/ansible-basic-usage.xml +++ b/references/ansible-basic-usage.xml @@ -126,7 +126,99 @@ plugin documentation tool - + + ansible-galaxy + + + A command-line tool that comes with Ansible and is used for managing and sharing roles. + &prompt.user;ansible-galaxy -h + Perform various Role and Collection related operations. + +positional arguments: + TYPE + collection Manage an Ansible Galaxy collection. + role Manage an Ansible Galaxy role. + +options: + --version show program's version number, config file location, configured module search path, module location, executable location and exit + -h, --help show this help message and exit + -v, --verbose Causes Ansible to print more debug messages. Adding multiple -v will increase the verbosity, the builtin plugins currently evaluate up to -vvvvvv. A reasonable level + to start is -vvv, connection debugging might require -vvvv. This argument may be specified multiple times. + + + + + ansible-inventory + + +Is a command-line tool that helps you inspect, validate and understand your inventory. + &prompt.user;ansible-inventory -h + usage: ansible-inventory [-h] [--version] [-v] [-i INVENTORY] [-l SUBSET] [--vault-id VAULT_IDS] [-J | --vault-password-file VAULT_PASSWORD_FILES] [--playbook-dir BASEDIR] + [-e EXTRA_VARS] [--list] [--host HOST] [--graph] [-y] [--toml] [--vars] [--export] [--output OUTPUT_FILE] + [group] + +Show Ansible inventory information, by default it uses the inventory script JSON format +[...] + + + + + ansible-playbook + + +Is a command-line tool that helps you inspect, validate and understand your inventory. + &prompt.user;ansible-playbook -h + usage: ansible-playbook [-h] [--version] [-v] [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] [--ssh-common-args SSH_COMMON_ARGS] + [--sftp-extra-args SFTP_EXTRA_ARGS] [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args SSH_EXTRA_ARGS] [-k | + --connection-password-file CONNECTION_PASSWORD_FILE] [--force-handlers] [--flush-cache] [-b] [--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K | + --become-password-file BECOME_PASSWORD_FILE] [-t TAGS] [--skip-tags SKIP_TAGS] [-C] [-D] [-i INVENTORY] [--list-hosts] [-l SUBSET] [-e EXTRA_VARS] + [--vault-id VAULT_IDS] [-J | --vault-password-file VAULT_PASSWORD_FILES] [-f FORKS] [-M MODULE_PATH] [--syntax-check] [--list-tasks] [--list-tags] [--step] + [--start-at-task START_AT_TASK] + playbook [playbook ...] + +Runs Ansible playbooks, executing the defined tasks on the targeted hosts. +[...] + + + + + ansible-pull + + + Is a command-line tool that inverts Ansible's default push-based architecture into a pull-based one. + Instead of a central control machine pushing configurations out to all the managed nodes, ansible-pullansible-pull is a command + that you run on each managed node. It tells that node to pull a playbook from a remote and then execute it. + + + &prompt.user;ansible-pull -h + ansible-pull -h + usage: ansible-pull [-h] [--version] [-v] [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] [--ssh-common-args SSH_COMMON_ARGS] + [--sftp-extra-args SFTP_EXTRA_ARGS] [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args SSH_EXTRA_ARGS] [-k | --connection-password-file CONNECTION_PASSWORD_FILE] + [--vault-id VAULT_IDS] [-J | --vault-password-file VAULT_PASSWORD_FILES] [-e EXTRA_VARS] [-t TAGS] [--skip-tags SKIP_TAGS] [-i INVENTORY] [--list-hosts] + [-l SUBSET] [-M MODULE_PATH] [-K | --become-password-file BECOME_PASSWORD_FILE] [--purge] [-o] [-s SLEEP] [-f] [-d DEST] [-U URL] [--full] [-C CHECKOUT] + [--accept-host-key] [-m MODULE_NAME] [--verify-commit] [--clean] [--track-subs] [--check] [--diff] + [playbook.yml ...] + + pulls playbooks from a VCS repo and executes them on target host +[...] + + + + + ansible-vault + + Is a command-line tool that allows you to encrypt sensitive data, such as passwords, API keys and other secrets + and store them securely within your playbooks and other configuration files. + &prompt.user;ansible-vault -h + usage: ansible-vault [-h] [--version] [-v] {create,decrypt,edit,view,encrypt,encrypt_string,rekey} ... + +encryption/decryption utility for Ansible data files + +[...] + + + +
Creating a playbook From 54d53daf1dbb74928c3a9958f55ab1e94b80ce26 Mon Sep 17 00:00:00 2001 From: Amrita Date: Tue, 16 Sep 2025 13:27:52 +0530 Subject: [PATCH 26/28] validation issues --- articles/ansible.asm.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index 9054e20a5..b16af237d 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -17,7 +17,6 @@ - From 52048f86018931b2bfab3225e36ed8379ed5b39b Mon Sep 17 00:00:00 2001 From: Amrita Date: Tue, 16 Sep 2025 13:31:11 +0530 Subject: [PATCH 27/28] validation issues --- articles/ansible.asm.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index b16af237d..e1e1ed248 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -133,9 +133,7 @@ - - - + From 18d1776ddff25941ca8831652d664485e0f7869d Mon Sep 17 00:00:00 2001 From: Amrita Date: Tue, 16 Sep 2025 17:42:14 +0530 Subject: [PATCH 28/28] what,why --- articles/ansible.asm.xml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/articles/ansible.asm.xml b/articles/ansible.asm.xml index e1e1ed248..845812b83 100644 --- a/articles/ansible.asm.xml +++ b/articles/ansible.asm.xml @@ -86,7 +86,9 @@ WHAT? - +This article gives an introduction to Ansible and guides you on how to automate repetitive IT tasks. +Ansible is an IT automation tool that simplifies configuration management,application deployment and +task orchestration by enabling you to define infrastructure as code in a simple way. @@ -94,7 +96,8 @@ WHY? - +Learn how to automate IT infrastructure with Ansible;how to install and configure, create +an inventory file and a playbook. @@ -102,7 +105,7 @@ EFFORT - +The average reading time of this article is approximately 40 minutes. @@ -112,12 +115,18 @@ - +Linux fundamentals:Understanding basic Linux commands,file permissions, directory structures +and usage of the command line. - +Networking:Ansible connects to remote machines via SSH so knowledge of IP addresses,SSH,host names and pots is required. + + + + +YAML:Ansible playbooks are written in YAML so knowing how to structure a YAML file is essential.