Move tasks to playbook/pre_tasks
This commit is contained in:
parent
996d22ac69
commit
b1f1ceefb5
2 changed files with 26 additions and 26 deletions
26
playbook.yml
26
playbook.yml
|
|
@ -1,8 +1,34 @@
|
||||||
- hosts: newsreader
|
- hosts: newsreader
|
||||||
become: true
|
become: true
|
||||||
become_method: sudo
|
become_method: sudo
|
||||||
|
pre_tasks:
|
||||||
|
- name: install packages
|
||||||
|
apt:
|
||||||
|
name: '{{ packages }}'
|
||||||
|
state: present
|
||||||
|
notify:
|
||||||
|
- restart postfix
|
||||||
|
- include_role:
|
||||||
|
name: common
|
||||||
|
tasks_from: 'network.yml'
|
||||||
|
- include_role:
|
||||||
|
name: common
|
||||||
|
tasks_from: 'host.yml'
|
||||||
|
- include_role:
|
||||||
|
name: common
|
||||||
|
tasks_from: 'sudoers.yml'
|
||||||
|
loop:
|
||||||
|
- { src: '../../templates/sudoers.j2', dest: '/etc/sudoers.d/30-ansible-extra' }
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
tasks:
|
tasks:
|
||||||
- import_tasks: 'tasks/main.yml'
|
- import_tasks: 'tasks/main.yml'
|
||||||
|
- include_role:
|
||||||
|
name: common
|
||||||
|
tasks_from: 'ssl.yml'
|
||||||
|
- include_role:
|
||||||
|
name: common
|
||||||
|
tasks_from: 'nginx.yml'
|
||||||
- import_tasks: 'tasks/setup.yml'
|
- import_tasks: 'tasks/setup.yml'
|
||||||
- import_tasks: 'tasks/poetry.yml'
|
- import_tasks: 'tasks/poetry.yml'
|
||||||
- import_tasks: 'tasks/project.yml'
|
- import_tasks: 'tasks/project.yml'
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,3 @@
|
||||||
- include_role:
|
|
||||||
name: common
|
|
||||||
tasks_from: 'network.yml'
|
|
||||||
- include_role:
|
|
||||||
name: common
|
|
||||||
tasks_from: 'host.yml'
|
|
||||||
- include_role:
|
|
||||||
name: common
|
|
||||||
tasks_from: 'sudoers.yml'
|
|
||||||
loop:
|
|
||||||
- { src: '../../templates/sudoers.j2', dest: '/etc/sudoers.d/30-ansible-extra' }
|
|
||||||
|
|
||||||
- name: install packages
|
|
||||||
apt:
|
|
||||||
name: '{{ packages }}'
|
|
||||||
state: present
|
|
||||||
notify:
|
|
||||||
- restart postfix
|
|
||||||
|
|
||||||
- name: copy firewall templates
|
- name: copy firewall templates
|
||||||
template:
|
template:
|
||||||
src: '{{ item.src }}'
|
src: '{{ item.src }}'
|
||||||
|
|
@ -93,13 +74,6 @@
|
||||||
}
|
}
|
||||||
notify: restart rabbitmq
|
notify: restart rabbitmq
|
||||||
|
|
||||||
- include_role:
|
|
||||||
name: common
|
|
||||||
tasks_from: 'ssl.yml'
|
|
||||||
- include_role:
|
|
||||||
name: common
|
|
||||||
tasks_from: 'nginx.yml'
|
|
||||||
|
|
||||||
- name: copy nginx config
|
- name: copy nginx config
|
||||||
template:
|
template:
|
||||||
src: 'templates/nginx.j2'
|
src: 'templates/nginx.j2'
|
||||||
|
|
|
||||||
Reference in a new issue