Difference between revisions of "Ansible Howto"

From Cactus Howto
Jump to navigationJump to search
(Die Seite wurde neu angelegt: „= ansible first steps = == documentation == * https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html == installation == On ubuntu / d…“)
 
Line 30: Line 30:
PLAY RECAP *********************************************************************
PLAY RECAP *********************************************************************
puppet : ok=2 changed=0 unreachable=0 failed=0
puppet : ok=2 changed=0 unreachable=0 failed=0

tim@spike-vm:~/ansi$ cat apt-install.yml
tim@spike-vm:~/ansi$ cat apt-install.yml
---
---

- hosts: all
- hosts: all
become: yes
become: yes

Revision as of 10:41, 17 November 2018

ansible first steps

documentation

installation

On ubuntu / debian:

sudo apt install ansible

initial config

Edit /etc/ansible/hosts

ansible advanced topics

use case change passwords

use case install apt package

tim@spike-vm:~/ansi$ ansible-playbook -l puppet apt-install.yml -K -e "package=apache2"
SUDO password: 

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [puppet]

TASK [install package "apache2"] ***********************************************
ok: [puppet]

PLAY RECAP *********************************************************************
puppet                     : ok=2    changed=0    unreachable=0    failed=0   
tim@spike-vm:~/ansi$ cat apt-install.yml 
---

- hosts: all
 become: yes
 tasks:
    - name: install package "Template:Package"
      apt:
       name: apache2
      when: >
       ansible_distribution == 'Debian'
       or
       ansible_distribution == 'Ubuntu'

use case add firewall rule

iptables

check point R80 API