diff --git a/first-playbook/ansible.cfg b/first-playbook/ansible.cfg new file mode 100644 index 0000000..0056832 --- /dev/null +++ b/first-playbook/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +inventory = inventory +private_key_file = ~/.ssh/hetzner + + diff --git a/first-playbook/install_apache.yml b/first-playbook/install_apache.yml new file mode 100644 index 0000000..e40ae9f --- /dev/null +++ b/first-playbook/install_apache.yml @@ -0,0 +1,18 @@ +--- +- hosts: all + become: true + tasks: + + - name: Update repository index + ansible.builtin.apt: + update_cache: yes + + - name: Install apache2 package + ansible.builtin.apt: + name: apache2 + state: latest + + - name: Install support for php + ansible.builtin.apt: + name: libapache2-mod-php + state: latest diff --git a/first-playbook/inventory b/first-playbook/inventory new file mode 100644 index 0000000..8b15755 --- /dev/null +++ b/first-playbook/inventory @@ -0,0 +1,2 @@ +10.0.0.7 +10.0.0.8 diff --git a/first-playbook/remove_apache.yml b/first-playbook/remove_apache.yml new file mode 100644 index 0000000..3d71d46 --- /dev/null +++ b/first-playbook/remove_apache.yml @@ -0,0 +1,18 @@ +--- +- hosts: all + become: true + tasks: + + - name: Update repository index + ansible.builtin.apt: + update_cache: yes + + - name: Install apache2 package + ansible.builtin.apt: + name: apache2 + state: absent + + - name: Install support for php + ansible.builtin.apt: + name: libapache2-mod-php + state: absent