ansible-host: Initial version of role
This commit is contained in:
parent
858a7d30d7
commit
f05112b125
2 changed files with 38 additions and 0 deletions
3
roles/ansible-host/meta/main.yml
Normal file
3
roles/ansible-host/meta/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- { role: epel-repo }
|
35
roles/ansible-host/tasks/main.yml
Normal file
35
roles/ansible-host/tasks/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
- name: check support
|
||||||
|
fail:
|
||||||
|
msg: Role not supported in your system
|
||||||
|
when: ansible_os_family != "RedHat"
|
||||||
|
|
||||||
|
- name: install ansible packages
|
||||||
|
package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: installed
|
||||||
|
with_items:
|
||||||
|
- ansible
|
||||||
|
- git
|
||||||
|
|
||||||
|
- name: create private directory and force permissions
|
||||||
|
file:
|
||||||
|
path: /export/private
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0700
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: link private directory
|
||||||
|
file:
|
||||||
|
src: "/srv/private"
|
||||||
|
dest: "/export/private"
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
state: link
|
||||||
|
follow: false
|
||||||
|
|
||||||
|
- name: clone ansible repository
|
||||||
|
git:
|
||||||
|
dest: /srv/ansible
|
||||||
|
repo: https://git.foo.sh/ansible.git
|
Loading…
Add table
Add a link
Reference in a new issue