- name: Install Zabbix-release CentOS 7
yum:
name: https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/z...
# --тут тоже нужен when
- name: install zabbix-agent
yum: name=zabbix-agent state=latest
when: ansible_os_family == "RedHat"
- name: Install the version '1.00' of package "foo"
ansible.builtin.apt:
name: foo=1.00
- name: postgresql status
command: systemctl status postgresql
register: p_status
- debug: var=p_status
- name: ensure postgresqt restarted
systemctl:
name: postgresql
state: restarted
- name: Create a symbolic link
ansible.builtin.file:
src: /file/to/link/to
dest: /path/to/symlink
owner: foo
group: foo
state: link
---
- hosts: localhost
gather_facts: no
handlers:
- name: restart something
debug: msg="Something restarted"
tasks:
- debug: msg="Special action"
changed_when: true
notify: restart something
role1
meta dependencies subrole
role2
meta dependencies subrole
subrole
handlers
ServerConfig="(.*)\b(name=[^\s]+)\b(.*)"|"(.*)\b(name=[^\s]+)?"
- hosts: master
pre_tasks:
- name: task will run before roles
copy: ...
roles:
- role: master_role
tasks:
- name: task will run after roles
copy: ...
- hosts: mirror
vars:
var_for_mirror_group: 42
roles:
- role: mirror_role
tasks:
- name: task 1
template: ...
- name: task 2
copy: ...
- hosts: slaves
roles:
- role: slaves_role
- hosts: all
roles:
- role: all_together_role