IT/Software/Ansible: Difference between revisions

From msgwiki
< IT‎ | Software
Jump to navigation Jump to search
Access restrictions were established for this page. If you see this message, you have no access to this page.
(Created page with "Ansible Ansible is an open source IT automation engine that automates provisioning, configuration management, application deployment, orchestration, and many other IT processes. It is free to use, and the project benefits from the experience and intelligence of its thousands of contributors. https://www.ansible.com/ Some pros: - reproducible - fast deployment - scalable Important files: inventory.yml This file contains a list of your hosts to which playbooks c...")
 
(added github repo link)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Ansible
= Ansible =
Ansible is an open source IT automation engine that automates provisioning, configuration management, application deployment, orchestration, and many other IT processes.It is free to use, and the project benefits from the experience and intelligence of its thousands of contributors.


Ansible is an open source IT automation engine that automates provisioning, configuration management, application deployment, orchestration, and many other IT processes. It is free to use, and the project benefits from the experience and intelligence of its thousands of contributors. 
https://www.ansible.com/
https://www.ansible.com/


Some pros:
'''Pros:'''  
- reproducible 
- fast deployment 
- scalable  


Important files:
* reproducible environments
inventory.yml
* easy to begin with
This file contains a list of your hosts to which playbooks can refer to.
* fast deployment
* scalable


playbook.yml
'''Cons:'''
Contains the tasks/steps that shoud be executed.
 
* small time investment to learn it
 
=== In a nutshell ===
 
* A Control Node executes tasks, defined in playbooks on Managed Nodes over SSH or API's
* Control Node: This can be any linux based host (or windows with wsl) where ansible is installed and is connected to the same network as the Managed Nodes
* Managed Node: Any device that should be managed or setup
* playbook.yml: A yml file that contains the involved hosts, process and tasks that should be done
* inventory.yml: A yml file that contains all hosts, grouped in sections if needed (e.g. different branches, locations, device/os types)


See also IaC/IaaC   
See also IaC/IaaC   
https://en.wikipedia.org/wiki/Infrastructure_as_code
https://en.wikipedia.org/wiki/Infrastructure_as_code


Install Ansible
=== Install Ansible ===
 
* https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
 
==== Linux ====


- https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
* <code>sudo apt install ansible</code>


Linux
==== Windows ====


- `sudo apt install ansible`
* install wsl first
* https://learn.microsoft.com/en-us/windows/wsl/install
* run in Terminal <code>wsl --install</code>


Windows
=== Execute Playbooks ===
* example with a playbook named playbook-example.yml and inventory.yml
* <code>ansible-playbook -i inventory.yml playbook-example.yml -kK</code>
* <code>-K</code> if become/sudo is needed
* <code>-k</code> for user/password based authentication


- install wsl first
==== Repository ====
- https://learn.microsoft.com/en-us/windows/wsl/install
- `wsl --install`


Execute Playbooks
* some easy scripts


- example with a playbook named playbook-example.yml
* https://github.com/stefannyffenegger/automation/tree/main/ansible
- `ansible-playbook -i inventory.yml playbook-example.yml -K`
- `-K` if become/sudo is needed

Latest revision as of 18:48, 10 May 2024

Ansible

Ansible is an open source IT automation engine that automates provisioning, configuration management, application deployment, orchestration, and many other IT processes.It is free to use, and the project benefits from the experience and intelligence of its thousands of contributors.

https://www.ansible.com/

Pros:

  • reproducible environments
  • easy to begin with
  • fast deployment
  • scalable

Cons:

  • small time investment to learn it

In a nutshell

  • A Control Node executes tasks, defined in playbooks on Managed Nodes over SSH or API's
  • Control Node: This can be any linux based host (or windows with wsl) where ansible is installed and is connected to the same network as the Managed Nodes
  • Managed Node: Any device that should be managed or setup
  • playbook.yml: A yml file that contains the involved hosts, process and tasks that should be done
  • inventory.yml: A yml file that contains all hosts, grouped in sections if needed (e.g. different branches, locations, device/os types)

See also IaC/IaaC https://en.wikipedia.org/wiki/Infrastructure_as_code

Install Ansible

Linux

  • sudo apt install ansible

Windows

Execute Playbooks

  • example with a playbook named playbook-example.yml and inventory.yml
  • ansible-playbook -i inventory.yml playbook-example.yml -kK
  • -K if become/sudo is needed
  • -k for user/password based authentication

Repository

  • some easy scripts