Initial commit with examples

This commit is contained in:
Jérémy Lecour 2016-12-21 15:39:50 +01:00 committed by Jérémy Lecour
commit 5a5731e7c5
11 changed files with 88 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.retry

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Ansible-public
```
$ ansible-playbook playbooks/evolinux.yml -i inventory/hosts -K
```

View File

@ -0,0 +1 @@
---

View File

@ -0,0 +1,4 @@
---
evolinux_hostname: ansible-test1
evolinux_domain: evolix.net
evolinux_fqdn: ansible-test1.evolix.net

View File

@ -0,0 +1,4 @@
---
evolinux_hostname: ansible-test2
evolinux_domain: evolix.net
evolinux_fqdn: ansible-test2.evolix.net

3
inventory/hosts Normal file
View File

@ -0,0 +1,3 @@
[ansible-test]
ansible-test1 ansible_user=evolix ansible_host=192.168.4.209
ansible-test2 ansible_user=evolix ansible_host=192.168.4.211

24
playbooks/evolinux.yml Normal file
View File

@ -0,0 +1,24 @@
- hosts: ansible-test
gather_facts: yes
become: yes
vars_files:
- "../vars/global.yml"
roles:
- "{{ roles }}/etc-git"
- "{{ roles }}/evolinux-base"
- "{{ roles }}/evolinux-admin-users"
- "{{ roles }}/munin"
- "{{ roles }}/minifirewall"
- "{{ roles }}/squid"
- "{{ roles }}/proftpd"
- "{{ roles }}/fail2ban"
- "{{ roles }}/listupgrade"
- "{{ roles }}/evomaintenance"
- "{{ roles }}/apt-repositories"
post_tasks:
- include: "{{ tasks }}/commit_etc_git.yml"
- include: "{{ tasks }}/run_evocheck.yml"
# vim:ft=ansible

15
playbooks/httpd.yml Normal file
View File

@ -0,0 +1,15 @@
- hosts: ansible-test
gather_facts: yes
become: yes
vars_files:
- "../vars/global.yml"
vars:
- evolinux_default_www_nginx_enabled: True
roles:
- "{{ roles }}/apache"
- "{{ roles }}/nginx"
- "{{ roles }}/evolinux-default-www"
# vim:ft=ansible:

18
tasks/commit_etc_git.yml Normal file
View File

@ -0,0 +1,18 @@
---
- name: is /etc clean?
command: git status --porcelain
args:
chdir: /etc
changed_when: False
register: git_status
tags:
- git
- name: /etc modifications are committed
shell: "git add -A . && git commit -m \"Ansible run\""
args:
chdir: /etc
register: etc_commit_end_evolinux
when: git_status.stdout != ""
tags:
- git

10
tasks/run_evocheck.yml Normal file
View File

@ -0,0 +1,10 @@
---
- name: run evocheck
command: /usr/share/scripts/evocheck.sh
register: evocheck_run
changed_when: False
# failed_when: False
- debug:
var: evocheck_run.stdout_lines
when: evocheck_run.rc != 0

3
vars/global.yml Normal file
View File

@ -0,0 +1,3 @@
---
roles: ../../ansible-roles
tasks: ../tasks