3 Commits

Author SHA1 Message Date
ba95e8a650 cibles 2023-12-22 14:19:24 +01:00
f8a1f469e6 solution epsi sans firewall 2023-12-22 10:04:55 +01:00
c92c54ff3b switch to fqmn 2023-01-20 12:32:15 +01:00

View File

@@ -1,15 +1,15 @@
---
- name: install apache via ansible playbook
hosts: centos
hosts: cibles
tasks:
- name: install apache
yum:
ansible.builtin.package:
name: httpd
state: present
- name: conf httpd
template:
ansible.builtin.template:
src: vhost.conf
dest: /etc/httpd/conf.d/vhost.conf
mode: 0640
@@ -17,44 +17,18 @@
group: apache
- name: activate apache
service:
ansible.builtin.service:
name: httpd
enabled: yes
state: started
- name: setup firewall
block:
- name: install firewalld packages
yum:
name:
- python3-firewall
- firewalld
state: present
- name: enable firewalld service
service:
name: firewalld
enabled: true
state: started
- name: open firewall port
firewalld:
service: "{{ item }}"
permanent: yes
immediate: yes
state: enabled
loop:
- http
- https
ignore_errors: true
- name: create documentroot
file:
ansible.builtin.file:
name: /var/www/html/example.org/
state: directory
- name: copy index file
template:
ansible.builtin.template:
src: index.txt
dest: /var/www/html/example.org/index.html
mode: 0644