mise au point support multi distribution

This commit is contained in:
2021-09-14 15:01:18 +02:00
parent 5123a8d280
commit 6e42991efa
8 changed files with 49 additions and 23 deletions

View File

@@ -1,4 +1,7 @@
---
- name: import OS variables
include_vars: "{{ ansible_distribution |lower }}{{ ansible_distribution_major_version }}.yml"
- name: installation
package:
name: "{{ apache_package_name }}"
@@ -8,10 +11,10 @@
notify: reload httpd
template:
src: vhost.conf
dest: /etc/httpd/conf.d/vhost.conf
dest: "{{ apache_config_dir }}/vhost.conf"
mode: 0640
owner: root
group: apache
group: "{{ apache_group_name }}"
- name: enable service
service:
@@ -28,30 +31,30 @@
- name: create documentroot
file:
name: "{{ apache_documentroot }}"
name: "/var/www/{{ apache_server_name }}"
state: directory
- name: create index file
template:
src: index.html
dest: "{{ apache_documentroot }}/index.html"
dest: "/var/www/{{ apache_server_name }}/index.html"
mode: 0644
- name: install python passlib package
package:
name: python3-passlib
name: "{{ python_passlib_package }}"
state: present
- name: passwd file
htpasswd:
path: "/etc/httpd/passwd"
path: "{{ apache_config_dir }}/passwd"
name: tom
password: "123Soleil"
mode: 0640
owner: root
group: "apache"
group: "{{ apache_group_name }}"
- name: start service
service:
name: "{{ apache_service_name }}"
state: restarted
state: started