Fast-Ansible: Ansible Tutorial, Sample Usage Scenarios (Howto: Hands-on LAB)
I want to share the Ansible tutorial, cheat sheet, and usage scenarios that I created as a notebook for myself. I know that Ansible is a detailed topic to learn in a short term, so I gathered useful information and create sample general usage scenarios of Ansible.
This repo covers Ansible with HowTo: Hands-on LABs (using Multipass: Ubuntu Lightweight VMs): Ad-Hoc Commands, Modules, Playbooks, Tags, Managing Files and Servers, Users, Roles, Handlers, Host Variables, Templates, and many details. Possible usage scenarios are aimed to update over time.
Tutorial Link: **https://github.com/omerbsezer/Fast-Ansible**
Extra Kubernetes-Tutorial Link: **https://github.com/omerbsezer/Fast-Kubernetes**
Extra Docker-Tutorial Link: **https://github.com/omerbsezer/Fast-Docker**
Quick Look (HowTo): Scenarios - Hands-on LABs
[LAB: Multipass-SSH Configuration (Create Ansible Test Environment)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Multipass-SSH-Configuration.md)
LAB: Install Ansible and Test Basic Ansible (Ad-Hoc) Commands
[LAB: Implement First Playbook](https://github.com/omerbsezer/Fast-Ansible/blob/main/Implement-First-Playbook.md)
LAB: Playing Docker Module
[LAB: Important (Mostly Possible Used) Modules Sample Tasks](https://github.com/omerbsezer/Fast-Ansible/blob/main/Important-Modules-Sample-Tasks.md)
LAB: Refactoring / Improving Playbook
[LAB: Targeting Specific Nodes (Grouping)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Targeting-Specific-Node.md)
LAB: Adding Tags
[LAB: Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/Managing-Files.md)
LAB: Managing Services
[LAB: Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/Adding-User.md)
LAB: Roles
[LAB: Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/Host-Variables.md)
LAB: Handlers
[LAB: Templates](https://github.com/omerbsezer/Fast-Ansible/blob/main/Templates.md)
Table of Contents
Motivation
[What is Ansible?](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#whatIsAnsible)
How Ansible Works?
[Creating LAB Environment](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#labEnvironment)
Ansible Basic (Ad-Hoc) Commands
[Ansible Modules](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#modules)
Ansible Playbooks
[Inventory File - Targeting Specific Nodes](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#inventory)
Tags
[Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#files)
Managing Services
[Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#users)
Roles
[Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#hostvariables)
I want to share the Ansible tutorial, cheat sheet, and usage scenarios that I created as a notebook for myself. I know that Ansible is a detailed topic to learn in a short term, so I gathered useful information and create sample general usage scenarios of Ansible.
This repo covers Ansible with HowTo: Hands-on LABs (using Multipass: Ubuntu Lightweight VMs): Ad-Hoc Commands, Modules, Playbooks, Tags, Managing Files and Servers, Users, Roles, Handlers, Host Variables, Templates, and many details. Possible usage scenarios are aimed to update over time.
Tutorial Link: **https://github.com/omerbsezer/Fast-Ansible**
Extra Kubernetes-Tutorial Link: **https://github.com/omerbsezer/Fast-Kubernetes**
Extra Docker-Tutorial Link: **https://github.com/omerbsezer/Fast-Docker**
Quick Look (HowTo): Scenarios - Hands-on LABs
[LAB: Multipass-SSH Configuration (Create Ansible Test Environment)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Multipass-SSH-Configuration.md)
LAB: Install Ansible and Test Basic Ansible (Ad-Hoc) Commands
[LAB: Implement First Playbook](https://github.com/omerbsezer/Fast-Ansible/blob/main/Implement-First-Playbook.md)
LAB: Playing Docker Module
[LAB: Important (Mostly Possible Used) Modules Sample Tasks](https://github.com/omerbsezer/Fast-Ansible/blob/main/Important-Modules-Sample-Tasks.md)
LAB: Refactoring / Improving Playbook
[LAB: Targeting Specific Nodes (Grouping)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Targeting-Specific-Node.md)
LAB: Adding Tags
[LAB: Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/Managing-Files.md)
LAB: Managing Services
[LAB: Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/Adding-User.md)
LAB: Roles
[LAB: Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/Host-Variables.md)
LAB: Handlers
[LAB: Templates](https://github.com/omerbsezer/Fast-Ansible/blob/main/Templates.md)
Table of Contents
Motivation
[What is Ansible?](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#whatIsAnsible)
How Ansible Works?
[Creating LAB Environment](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#labEnvironment)
Ansible Basic (Ad-Hoc) Commands
[Ansible Modules](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#modules)
Ansible Playbooks
[Inventory File - Targeting Specific Nodes](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#inventory)
Tags
[Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#files)
Managing Services
[Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#users)
Roles
[Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#hostvariables)
GitHub
GitHub - omerbsezer/Fast-Ansible: This repo covers Ansible with LABs: Multipass, Commands, Modules, Playbooks, Tags, Managing Files…
This repo covers Ansible with LABs: Multipass, Commands, Modules, Playbooks, Tags, Managing Files and Servers, Users, Roles, Handlers, Host Variables, Templates and details. - omerbsezer/Fast-Ansible
Fast-Ansible: Ansible Tutorial, Sample Usage Scenarios (Howto: Hands-on LAB)
I want to share the Ansible tutorial, cheat sheet, and usage scenarios that I created as a notebook for myself. I know that Ansible is a detailed topic to learn in a short term, so I gathered useful information and create sample general usage scenarios of Ansible.
This repo covers Ansible with HowTo: Hands-on LABs (using Multipass: Ubuntu Lightweight VMs): Ad-Hoc Commands, Modules, Playbooks, Tags, Managing Files and Servers, Users, Roles, Handlers, Host Variables, Templates, and many details. Possible usage scenarios are aimed to update over time.
**Tutorial Link:** [**https://github.com/omerbsezer/Fast-Ansible**](https://github.com/omerbsezer/Fast-Ansible)
**Extra Kubernetes-Tutorial Link:** [**https://github.com/omerbsezer/Fast-Kubernetes**](https://github.com/omerbsezer/Fast-Kubernetes)
**Extra Docker-Tutorial Link:** [**https://github.com/omerbsezer/Fast-Docker**](https://github.com/omerbsezer/Fast-Docker)
Quick Look (HowTo): Scenarios - Hands-on LABs
* [LAB: Multipass-SSH Configuration (Create Ansible Test Environment)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Multipass-SSH-Configuration.md)
* [LAB: Install Ansible and Test Basic Ansible (Ad-Hoc) Commands](https://github.com/omerbsezer/Fast-Ansible/blob/main/Install-Ansible-Basic-Commands.md)
* [LAB: Implement First Playbook](https://github.com/omerbsezer/Fast-Ansible/blob/main/Implement-First-Playbook.md)
* [LAB: Playing Docker Module](https://github.com/omerbsezer/Fast-Ansible/blob/main/Docker-Module.md)
* [LAB: Important (Mostly Possible Used) Modules Sample Tasks](https://github.com/omerbsezer/Fast-Ansible/blob/main/Important-Modules-Sample-Tasks.md)
* [LAB: Refactoring / Improving Playbook](https://github.com/omerbsezer/Fast-Ansible/blob/main/Refactoring-Playbook.md)
* [LAB: Targeting Specific Nodes (Grouping)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Targeting-Specific-Node.md)
* [LAB: Adding Tags](https://github.com/omerbsezer/Fast-Ansible/blob/main/Tags.md)
* [LAB: Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/Managing-Files.md)
* [LAB: Managing Services](https://github.com/omerbsezer/Fast-Ansible/blob/main/Managing-Services.md)
* [LAB: Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/Adding-User.md)
* [LAB: Roles](https://github.com/omerbsezer/Fast-Ansible/blob/main/Roles.md)
* [LAB: Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/Host-Variables.md)
* [LAB: Handlers](https://github.com/omerbsezer/Fast-Ansible/blob/main/Handlers.md)
* [LAB: Templates](https://github.com/omerbsezer/Fast-Ansible/blob/main/Templates.md)
Table of Contents
* [Motivation](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#motivation)
* [What is Ansible?](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#whatIsAnsible)
* [How Ansible Works?](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#howAnsibleWorks)
* [Creating LAB Environment](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#labEnvironment)
* [Ansible Basic (Ad-Hoc) Commands](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#commands)
* [Ansible Modules](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#modules)
* [Ansible Playbooks](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#playbooks)
* [Inventory File - Targeting Specific Nodes](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#inventory)
* [Tags](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#tags)
* [Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#files)
* [Managing Services](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#services)
* [Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#users)
* [Roles](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#roles)
* [Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#hostvariables)
*
I want to share the Ansible tutorial, cheat sheet, and usage scenarios that I created as a notebook for myself. I know that Ansible is a detailed topic to learn in a short term, so I gathered useful information and create sample general usage scenarios of Ansible.
This repo covers Ansible with HowTo: Hands-on LABs (using Multipass: Ubuntu Lightweight VMs): Ad-Hoc Commands, Modules, Playbooks, Tags, Managing Files and Servers, Users, Roles, Handlers, Host Variables, Templates, and many details. Possible usage scenarios are aimed to update over time.
**Tutorial Link:** [**https://github.com/omerbsezer/Fast-Ansible**](https://github.com/omerbsezer/Fast-Ansible)
**Extra Kubernetes-Tutorial Link:** [**https://github.com/omerbsezer/Fast-Kubernetes**](https://github.com/omerbsezer/Fast-Kubernetes)
**Extra Docker-Tutorial Link:** [**https://github.com/omerbsezer/Fast-Docker**](https://github.com/omerbsezer/Fast-Docker)
Quick Look (HowTo): Scenarios - Hands-on LABs
* [LAB: Multipass-SSH Configuration (Create Ansible Test Environment)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Multipass-SSH-Configuration.md)
* [LAB: Install Ansible and Test Basic Ansible (Ad-Hoc) Commands](https://github.com/omerbsezer/Fast-Ansible/blob/main/Install-Ansible-Basic-Commands.md)
* [LAB: Implement First Playbook](https://github.com/omerbsezer/Fast-Ansible/blob/main/Implement-First-Playbook.md)
* [LAB: Playing Docker Module](https://github.com/omerbsezer/Fast-Ansible/blob/main/Docker-Module.md)
* [LAB: Important (Mostly Possible Used) Modules Sample Tasks](https://github.com/omerbsezer/Fast-Ansible/blob/main/Important-Modules-Sample-Tasks.md)
* [LAB: Refactoring / Improving Playbook](https://github.com/omerbsezer/Fast-Ansible/blob/main/Refactoring-Playbook.md)
* [LAB: Targeting Specific Nodes (Grouping)](https://github.com/omerbsezer/Fast-Ansible/blob/main/Targeting-Specific-Node.md)
* [LAB: Adding Tags](https://github.com/omerbsezer/Fast-Ansible/blob/main/Tags.md)
* [LAB: Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/Managing-Files.md)
* [LAB: Managing Services](https://github.com/omerbsezer/Fast-Ansible/blob/main/Managing-Services.md)
* [LAB: Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/Adding-User.md)
* [LAB: Roles](https://github.com/omerbsezer/Fast-Ansible/blob/main/Roles.md)
* [LAB: Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/Host-Variables.md)
* [LAB: Handlers](https://github.com/omerbsezer/Fast-Ansible/blob/main/Handlers.md)
* [LAB: Templates](https://github.com/omerbsezer/Fast-Ansible/blob/main/Templates.md)
Table of Contents
* [Motivation](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#motivation)
* [What is Ansible?](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#whatIsAnsible)
* [How Ansible Works?](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#howAnsibleWorks)
* [Creating LAB Environment](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#labEnvironment)
* [Ansible Basic (Ad-Hoc) Commands](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#commands)
* [Ansible Modules](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#modules)
* [Ansible Playbooks](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#playbooks)
* [Inventory File - Targeting Specific Nodes](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#inventory)
* [Tags](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#tags)
* [Managing Files](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#files)
* [Managing Services](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#services)
* [Adding Users](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#users)
* [Roles](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#roles)
* [Host Variables](https://github.com/omerbsezer/Fast-Ansible/blob/main/README.md#hostvariables)
*
Couple of doubts regarding YAML's syntaxes.
Everything in YAML, at least visually seems to be the exact same key: pair combination, I've familiarized myself with all the YAML syntaxes but I'm having a really hard time figuring out whether what I'm entering is an an Array, Sequence, Set, Map, Collection, Dictionary or an Object.
1. I simply use [ \] for simple values and { } for key: value pairs. The only real difference I could notice is that when using [ \] , you can have duplicates inside but if you enclose the same content within { } , then the duplicate items disappear. Am I missing something more important here?
2. Also can someone please explain the purpose of ? Sets in YAML, is it only there to assign null value to the key and delete any duplicate entries? And why are they emphazing in bold that it's "Unordered" unlike "Ordered" Lists.?
3. You can use * to call all the values of & , so why use << on top of it, isn't it redundant?
ref: &ref
girl: F
boy: M
Gender: *ref
4. The most confusing of all for me is Tags, I read the YAML documentation about tag handles, verbatim, shorthand. The more I read, the more confused I get.
I know that !! is used to specify data type and also you can enter a tag using the key: value pair method, but have no idea on how to properly use the single quotation ! tag and the %Tag directive.
%TAG !e! tag:example.com,2000:app/
\---
!e!foo "bar"
!<tag:example.com,2000:app/foo> "bar"
To me this code seems to function exactly like an Anchor / Alias combo rather than an actual Tag. So essentially, we're replacing the !e! with the URL. Isn't the primary goal of #Tags is to help find your content and resolve your search queries faster, I don't see it happening anywhere here.
​
Sorry if the questions are too basic or outright dumb.
https://redd.it/z0xkec
@r_devops
Everything in YAML, at least visually seems to be the exact same key: pair combination, I've familiarized myself with all the YAML syntaxes but I'm having a really hard time figuring out whether what I'm entering is an an Array, Sequence, Set, Map, Collection, Dictionary or an Object.
1. I simply use [ \] for simple values and { } for key: value pairs. The only real difference I could notice is that when using [ \] , you can have duplicates inside but if you enclose the same content within { } , then the duplicate items disappear. Am I missing something more important here?
2. Also can someone please explain the purpose of ? Sets in YAML, is it only there to assign null value to the key and delete any duplicate entries? And why are they emphazing in bold that it's "Unordered" unlike "Ordered" Lists.?
3. You can use * to call all the values of & , so why use << on top of it, isn't it redundant?
ref: &ref
girl: F
boy: M
Gender: *ref
4. The most confusing of all for me is Tags, I read the YAML documentation about tag handles, verbatim, shorthand. The more I read, the more confused I get.
I know that !! is used to specify data type and also you can enter a tag using the key: value pair method, but have no idea on how to properly use the single quotation ! tag and the %Tag directive.
%TAG !e! tag:example.com,2000:app/
\---
!e!foo "bar"
!<tag:example.com,2000:app/foo> "bar"
To me this code seems to function exactly like an Anchor / Alias combo rather than an actual Tag. So essentially, we're replacing the !e! with the URL. Isn't the primary goal of #Tags is to help find your content and resolve your search queries faster, I don't see it happening anywhere here.
​
Sorry if the questions are too basic or outright dumb.
https://redd.it/z0xkec
@r_devops
reddit
Couple of doubts regarding YAML's syntaxes.
Everything in YAML, at least visually seems to be the exact same key: pair combination, I've familiarized myself with all the YAML syntaxes but...