serverctl/infrastructure/create-resources/apache-install.yml
kjuulh e9671cbe81
Some checks failed
continuous-integration/drone/push Build is failing
Always run ansible
2022-02-18 15:50:37 +01:00

36 lines
785 B
YAML

- become: yes
hosts: all
name: apache-install
tasks:
- name: Add the user 'kjuulh' and add it to 'sudo'
user:
name: kjuulh
group: sudo
- name:
authorized_key:
user: kjuulh
state: present
key: "{{ lookup('file', pub_key) }}"
- name: Wait for apt to unlock
become: yes
shell: while sudo fuser /var/lib/dpkg/lock >/dev/null >2&1; do sleep 5; done;
- name: Install apache2
apt:
name: apache2
update_cache: yes
state: latest
- name: enable mod_rewrite
apache2_module:
name: rewrite
state: present
notify:
- Restart apache2
handlers:
- name: Restart apache2
service:
name: apache2
state: restarted