Пофиксил униерсальность и добавил centos и ubuntu
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
---
|
||||
- name: Deploy roles
|
||||
hosts: production
|
||||
hosts: all
|
||||
become: true
|
||||
become_user: root
|
||||
become_method: ansible.builtin.sudo
|
||||
gather_facts: true
|
||||
roles:
|
||||
- role
|
||||
vars_files:
|
||||
- ../vars/secrets.yml
|
||||
4
roles/role/tasks/debian/main.yaml
Normal file
4
roles/role/tasks/debian/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: Пример таски
|
||||
debug:
|
||||
msg: "Привет! Я запустился на Debian/Ubuntu! Переменная role_test равна {{ role_test }}"
|
||||
@@ -1,4 +1,12 @@
|
||||
---
|
||||
- name: Example task
|
||||
debug:
|
||||
msg: "Hello, Ansible!"
|
||||
- name: "Определяем ОС"
|
||||
set_fact:
|
||||
os_family: "{{ ansible_facts['os_family'] }}"
|
||||
|
||||
- name: "Подключаем таски для RedHat совместимых"
|
||||
include_tasks: "redhat/main.yaml"
|
||||
when: os_family == "RedHat"
|
||||
|
||||
- name: "Подключаем таски для Debian/Ubuntu совместимых"
|
||||
include_tasks: "debian/main.yaml"
|
||||
when: os_family == "Debian"
|
||||
|
||||
4
roles/role/tasks/redhat/main.yaml
Normal file
4
roles/role/tasks/redhat/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: Пример таски
|
||||
debug:
|
||||
msg: "Привет! Я запустился на RedHat/CentOS/Fedora!"
|
||||
@@ -1,6 +0,0 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
30363439326335316131303133653930363431336539356134363933656566663330366165616366
|
||||
6639353565306634613164636161353362643237353933610a323838666436363835303765323930
|
||||
62333364613535656138623233666635303934376234633937666131366239323436333334646666
|
||||
6364303839396532310a633636333665346538313931366666333665363163623966666236346666
|
||||
6464
|
||||
Reference in New Issue
Block a user