ansible-host: Publish ansible facts with nginx
This commit is contained in:
parent
88157dcc91
commit
aac14db657
3 changed files with 27 additions and 0 deletions
4
roles/ansible-host/files/nginx.conf
Normal file
4
roles/ansible-host/files/nginx.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
location /facts {
|
||||
autoindex on;
|
||||
autoindex_format json;
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
dependencies:
|
||||
- { role: epel-repo }
|
||||
- { role: nginx/server }
|
||||
|
|
|
@ -30,12 +30,34 @@
|
|||
state: link
|
||||
follow: false
|
||||
|
||||
- name: allow http server to access /srv/ansible
|
||||
sefcontext:
|
||||
path: /srv/ansible(/.*)?
|
||||
setype: httpd_sys_content_t
|
||||
- name: clone ansible repository
|
||||
git:
|
||||
dest: /srv/ansible
|
||||
repo: https://git.foo.sh/ansible.git
|
||||
update: false
|
||||
|
||||
- name: link facts to nginx
|
||||
file:
|
||||
src: "/srv/ansible/facts"
|
||||
dest: "/srv/web/{{ inventory_hostname }}/facts"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
state: link
|
||||
follow: false
|
||||
|
||||
- name: create nginx conf
|
||||
copy:
|
||||
src: nginx.conf
|
||||
dest: /etc/nginx/conf.d/{{ inventory_hostname }}/ansible.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart nginx
|
||||
|
||||
- name: add custom .bashrc for root
|
||||
copy:
|
||||
dest: /root/.bashrc
|
||||
|
|
Loading…
Add table
Reference in a new issue