From cb86aca658b6a35ceeacbd1526f6469249fd0ee2 Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Sun, 23 Jun 2024 07:39:43 +0200 Subject: [PATCH] install apache not from apache role --- inst-apache.yml | 44 ++++++++++++++++++++++++++++++++++++++++++ main.yml | 5 ++--- roles/requirements.yml | 3 --- 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 inst-apache.yml diff --git a/inst-apache.yml b/inst-apache.yml new file mode 100644 index 0000000..4b23e4a --- /dev/null +++ b/inst-apache.yml @@ -0,0 +1,44 @@ +--- +- name: install apache + yum: + state: installed + name: + - httpd + - mod_ssl + +- name: start and enable the httpd service + service: + state: started + name: httpd + enabled: true + +- name: open http port + firewalld: + service: http + permanent: true + immediate: true + state: enabled + +- name: open https port + firewalld: + service: https + permanent: true + immediate: true + state: enabled + +- name: create cert path + file: + path: /etc/httpd/certs + state: directory + +- name: delete welcome.conf + file: + path: /etc/httpd/conf.d/welcome.conf + state: absent + +- name: modify config to not navigate on os from browser (You don't have permission to access / on this server.) + lineinfile: + path: /etc/httpd/conf/httpd.conf + regexp: 'Options Indexes FollowSymLinks' + line: '#Options Indexes FollowSymLinks' + notify: restart httpd \ No newline at end of file diff --git a/main.yml b/main.yml index a17a8c3..63de190 100644 --- a/main.yml +++ b/main.yml @@ -22,7 +22,6 @@ import_role: name: role-netdata - - name: import apache role - import_role: - name: role-apache + - include_tasks: inst-apache.yml + \ No newline at end of file diff --git a/roles/requirements.yml b/roles/requirements.yml index 57d84f8..4a782bf 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -5,9 +5,6 @@ - name: role-yum-check src: git+https://gitweb.dyndns.org/scripts/yum-check.git -- name: role-apache - src: git+https://gitweb.dyndns.org/awx/role-apache.git - - name: role-netdata src: git+https://gitweb.dyndns.org/awx/role_netdata.git