Compare commits

...

1 Commits
v0.9 ... master

Author SHA1 Message Date
“cameron.desrayaud”
928fda2aa8 ajout yml 2022-01-24 14:24:14 +01:00
14 changed files with 8739 additions and 0 deletions

2
nxc/hosts Normal file
View File

@ -0,0 +1,2 @@
[test]
192.168.0.22

11
nxc/inst-nxc.yml Normal file
View File

@ -0,0 +1,11 @@
---
- name: Installation de Docker Nextcloud et Traefik
hosts: test
become: yes
become_method: sudo
remote_user: root
roles:
- docker
- nextcloud
- traefik

View File

@ -0,0 +1,15 @@
---
- name: Téléchargement get.docker
get_url:
url: http://s-adm/gsbstore/getdocker.sh
dest: /tmp
mode: '0755'
- name: Execution du script get_docker
script: /tmp/get_docker.sh
- name: Téléchargement docker-compose
get_url:
url: http://s-adm/gsbstore/docker-compose
dest: /usr/local/bin
mode: '0755'

View File

@ -0,0 +1,32 @@
---
- name: Creation du repertoire nextcloud
file:
path: /root/nxc
state: directory
- name: Download foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
mode: '0755'
- name: Execution du script get_docker
script: /root/nextcloud/get_docker.sh
- name: Installation de docker-compose
shell: curl -L "https://github.com/docker/compose/releases/download/1.28.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- name: Attribution des droits de docker compose
file:
path: /usr/local/bin/docker-compose
mode: '755'
- name: Copie de docker-compose.yml
copy:
src: /root/tools/ansible/gsb2021/roles/docker-nextcloud/files/docker-compose.yml
dest: /root/nextcloud
- name: Execution du fichier docker-compose.yml
shell: docker-compose up -d
args:
chdir: /root/nextcloud

0
testansible/.web.yml.swp Normal file
View File

View File

@ -0,0 +1,5 @@
---
- hosts: all
roles:
- web
- doku

View File

@ -0,0 +1,10 @@
- name: installation apache2
apt:
name: apache2
state: present
- name: installation php
apt:
name: php
state: present

6
testansible/hosts Normal file
View File

@ -0,0 +1,6 @@
[adm]
infra
[web]
web1
web2

1
testansible/index.html Normal file
View File

@ -0,0 +1 @@
On m'appelle l'ovni

8567
testansible/squid.conf.j2 Normal file

File diff suppressed because it is too large Load Diff

16
testansible/squid.yml Normal file
View File

@ -0,0 +1,16 @@
---
- hosts:
tasks:
- name: install squid
apt :
name: squid
state: present
- name: mise en place du fichier de conf
template:
src: squid.conf.j2
dest: /etc/squid/squid.conf
notify:
- restart squid

View File

@ -0,0 +1,25 @@
- hosts: web
tasks:
- name: on decommente l'option ForwardToSyslog=yes dans /etc/systemd/journald>
replace:
path: /etc/systemd/journald.conf
regexp: '^#ForwardToSyslog=yes'
replace: 'ForwardToSyslog=yes'
notify:
- restart journald
- name: Ajoute l'indication de serveur syslog distant
lineinfile:
path: /etc/rsyslog.conf
line: '*.* @192.168.0.37:514'
create: yes
notify:
- restart rsyslog
handlers:
- name: restart journald
service:
name: systemd-journald.service
state: restarted
- name: restart rsyslog
service:
name: rsyslog
state: restarted

22
testansible/syslog.yml Normal file
View File

@ -0,0 +1,22 @@
- hosts: adm
tasks:
- name: on active le module imudp dans /etc/rsyslog.conf
replace:
path: /etc/rsyslog.conf
regexp: '^#module\(load="imudp"\)'
replace: 'module(load="imudp")'
notify:
- restart rsyslog
- name: on decommente la ligne input type imudp port 514 dans /etc/rsyslog.conf
replace:
path: /etc/rsyslog.conf
regexp: '^#input\(type="imudp" port="514"\)'
replace: 'input(type="imudp" port="514")'
notify:
- restart rsyslog
handlers:
- name: restart rsyslog
service:
name: rsyslog
state: restarted

27
testansible/web.yml Normal file
View File

@ -0,0 +1,27 @@
---
- hosts: web
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: install apache2
apt :
name: apache2
state: present
- name: install php
apt :
name: php
state: present
- name: install php-mbstring
apt :
name: php-mbstring
state: present
- name: apache is running
service:
name: apache2
state: started
- name: copie fichier index.html
copy:
src: index.html
dest: /var/www/html/