Difference between revisions of "IT-SDK-Ansible"

From wiki.samerhijazi.net
Jump to navigation Jump to search
Line 1: Line 1:
 
=Ref.=
 
=Ref.=
 
*https://docs.ansible.com/ansible/latest/collections/all_plugins.html
 
*https://docs.ansible.com/ansible/latest/collections/all_plugins.html
==Kostenlose Kurse==
+
*https://www.redhat.com/de/services/training/do007-ansible-essentials-simplicity-automation-technical-overview?sc_cid=701f2000001OQFsAAO
* Ansible: https://www.redhat.com/de/services/training/do007-ansible-essentials-simplicity-automation-technical-overview?sc_cid=701f2000001OQFsAAO
+
=Notes=
 
* Ansible: playbooks, roles, variables, basic modules
 
* Ansible: playbooks, roles, variables, basic modules
 +
=Commands=
 +
<pre class="code">
 +
 +
</pre>
 +
 +
=Inventory=
 +
* /etc/ansible/hosts
 +
<pre class="code">
 +
 +
</pre>
 +
 +
=Playbook=
 +
<pre class="code">
 +
# Play 1
 +
---
 +
- name: this playbook will install httpd  ## Name of the Play
 +
  hosts: web                              ## In which Node shall the play done
 +
  tasks:                                  ## Tasks in this play
 +
    - name: Install latest of Apache      ## Name of the Task
 +
      become: ture                        ## Execute this Task as "sudo dnf install httpd"
 +
      become_user: weblogic              ## Exceute this task as "sudo -u weblogic dnf install httpd"
 +
      dnf:                                ## Name of the Modul used (etc. command, apt, user, service )
 +
        name: httpd                      ## Parameter used form modul
 +
        state: latest                    ## Parameter used form modul
 +
</pre>

Revision as of 14:25, 31 July 2021

Ref.

Notes

  • Ansible: playbooks, roles, variables, basic modules

Commands


Inventory

  • /etc/ansible/hosts

Playbook

# Play 1
---
- name: this playbook will install httpd  ## Name of the Play
  hosts: web                              ## In which Node shall the play done
  tasks:                                  ## Tasks in this play
    - name: Install latest of Apache      ## Name of the Task
      become: ture                        ## Execute this Task as "sudo dnf install httpd"
      become_user: weblogic               ## Exceute this task as "sudo -u weblogic dnf install httpd"
      dnf:                                ## Name of the Modul used (etc. command, apt, user, service )
        name: httpd                       ## Parameter used form modul
        state: latest                     ## Parameter used form modul