fix: fix configuration and refactor
This commit is contained in:
+31
-40
@@ -1,45 +1,36 @@
|
||||
---
|
||||
- name: Update all packages Ubuntu
|
||||
when: ansible_os_family == 'Debian'
|
||||
apt:
|
||||
update_cache: yes
|
||||
upgrade: yes
|
||||
|
||||
- name: Update all packages CentOS
|
||||
when: ansible_os_family == 'RedHat'
|
||||
yum:
|
||||
name: '*'
|
||||
state: latest
|
||||
|
||||
- name: Install nginx 'Ubuntu'
|
||||
when: ansible_os_family == 'Debian'
|
||||
ansible.builtin.apt:
|
||||
package:
|
||||
- nginx
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Install nginx 'RedHat'
|
||||
when: ansible_os_family == 'RedHat'
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- nginx
|
||||
state: present
|
||||
- name: Update all packages Ubuntu
|
||||
when: ansible_os_family == 'Debian'
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
upgrade: true
|
||||
|
||||
- name: Copy config nginx
|
||||
ansible.builtin.template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/nginx.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: Reload nginx service
|
||||
- name: Update all packages CentOS
|
||||
when: ansible_os_family == 'RedHat'
|
||||
ansible.builtin.yum:
|
||||
name: "*"
|
||||
state: latest
|
||||
|
||||
- name: Install nginx 'Ubuntu'
|
||||
when: ansible_os_family == 'Debian'
|
||||
ansible.builtin.apt:
|
||||
package:
|
||||
- nginx
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Install nginx 'RedHat'
|
||||
when: ansible_os_family == 'RedHat'
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- nginx
|
||||
state: present
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- name: Copy config nginx
|
||||
ansible.builtin.template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/nginx.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: Reload nginx service
|
||||
|
||||
Reference in New Issue
Block a user