Playbook onfarbo41
This commit is contained in:
parent
e428c52cbe
commit
ca000e0b57
8
AP4/onfarbo41/ansible/adminer.yml
Normal file
8
AP4/onfarbo41/ansible/adminer.yml
Normal file
@ -0,0 +1,8 @@
|
||||
- name: Playbook pour adminer
|
||||
hosts: onfarbo
|
||||
become: yes
|
||||
become_method: sudo
|
||||
become_user: root
|
||||
|
||||
roles:
|
||||
- adminer
|
8
AP4/onfarbo41/ansible/db.yml
Normal file
8
AP4/onfarbo41/ansible/db.yml
Normal file
@ -0,0 +1,8 @@
|
||||
- name: Playbook pour la BDD
|
||||
hosts: onfarbo
|
||||
become: yes
|
||||
become_method: sudo
|
||||
become_user: root
|
||||
|
||||
roles:
|
||||
- db
|
8
AP4/onfarbo41/ansible/dokuwiki.yml
Normal file
8
AP4/onfarbo41/ansible/dokuwiki.yml
Normal file
@ -0,0 +1,8 @@
|
||||
- name: Playbook pour le dokuwiki
|
||||
hosts: onfarbo
|
||||
become: yes
|
||||
become_method: sudo
|
||||
become_user: root
|
||||
|
||||
roles:
|
||||
- dokuwiki
|
@ -1,4 +1,2 @@
|
||||
[localhost]
|
||||
|
||||
[onfarbo]
|
||||
onfarbo41
|
||||
|
@ -1,8 +1,10 @@
|
||||
- name: Playbook pour onfarbo
|
||||
hosts: onfarbo
|
||||
- name: Playbook pour onfarbo41
|
||||
hosts: test
|
||||
become: yes
|
||||
become_method: sudo
|
||||
become_user: root
|
||||
|
||||
roles:
|
||||
- onfarbo
|
||||
- adminer
|
||||
- db
|
||||
- dokuwiki
|
||||
|
34
AP4/onfarbo41/ansible/roles/adminer/tasks/main.yml
Normal file
34
AP4/onfarbo41/ansible/roles/adminer/tasks/main.yml
Normal file
@ -0,0 +1,34 @@
|
||||
- name: apt update
|
||||
tags: update
|
||||
apt:
|
||||
update-cache: yes
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: install utils
|
||||
tags: utils
|
||||
apt:
|
||||
name:
|
||||
- apache2
|
||||
- php
|
||||
- php-common
|
||||
- libapache2-mod-php
|
||||
- php-cli
|
||||
- php-xml
|
||||
- php-mysql
|
||||
- php-curl
|
||||
- mariadb-server
|
||||
- adminer
|
||||
- python3-pymysql
|
||||
state: present
|
||||
|
||||
- name: On créer un lien symbolique
|
||||
tags: link
|
||||
file:
|
||||
src: /usr/share/adminer/adminer
|
||||
dest: /var/www/html/adminer
|
||||
state: link
|
||||
|
||||
- name: Message d'information
|
||||
tags: msg
|
||||
debug: msg="Adminer sera accessible depuis l'adresse http://onfarbo41/adminer.php"
|
||||
|
4
AP4/onfarbo41/ansible/roles/db/handlers/main.yml
Normal file
4
AP4/onfarbo41/ansible/roles/db/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- name: restart apache
|
||||
service:
|
||||
name: apache2
|
||||
state: restarted
|
20
AP4/onfarbo41/ansible/roles/db/tasks/main.yml
Normal file
20
AP4/onfarbo41/ansible/roles/db/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
- name: On démarre MariaDB
|
||||
tags: mariadb
|
||||
service:
|
||||
name: mysql
|
||||
state: started
|
||||
|
||||
- name: Création de la BDD bdarbre
|
||||
tags: bdarbre
|
||||
mysql_db:
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||
name: bdarbre
|
||||
|
||||
- name: Création de l'utilisateur slam
|
||||
tags: user
|
||||
mysql_user:
|
||||
name: slam
|
||||
password: Azerty1+
|
||||
priv: '*.*:ALL,GRANT'
|
||||
state: present
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
4
AP4/onfarbo41/ansible/roles/dokuwiki/handlers/main.yml
Normal file
4
AP4/onfarbo41/ansible/roles/dokuwiki/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- name: restart apache
|
||||
service:
|
||||
name: apache2
|
||||
state: restarted
|
26
AP4/onfarbo41/ansible/roles/dokuwiki/tasks/main.yml
Normal file
26
AP4/onfarbo41/ansible/roles/dokuwiki/tasks/main.yml
Normal file
@ -0,0 +1,26 @@
|
||||
- name: Création du dossier DokuWiki
|
||||
tags: createfile
|
||||
file:
|
||||
path: /root/dokuwiki
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: copie du fichier script d'install de dokuwiki
|
||||
tags: sh
|
||||
copy:
|
||||
src: dokuwiki.sh
|
||||
dest: /root/dokuwiki
|
||||
|
||||
- name: On rend exécutable le script d'install
|
||||
tags: chmod
|
||||
file:
|
||||
path: /root/dokuwiki/dokuwiki.sh
|
||||
mode: 0755
|
||||
|
||||
- name: exécution du script d'install de dokuwiki
|
||||
tags: exec
|
||||
command: bash /root/dokuwiki/dokuwiki.sh
|
||||
|
||||
- name: Message d'information pour dokuwiki
|
||||
tags: msg2
|
||||
debug: msg="Le dokuwiki devra être installer depuis l'adresse http://onfarbo41/doku/install.php"
|
@ -1,83 +0,0 @@
|
||||
- name: apt update
|
||||
tags: update
|
||||
apt:
|
||||
update-cache: yes
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: install utils
|
||||
tags: utils
|
||||
apt:
|
||||
name:
|
||||
- apache2
|
||||
- php
|
||||
- php-common
|
||||
- libapache2-mod-php
|
||||
- php-cli
|
||||
- php-xml
|
||||
- php-mysql
|
||||
- php-curl
|
||||
- mariadb-server
|
||||
- adminer
|
||||
- python3-pymysql
|
||||
state: present
|
||||
|
||||
- name: On fait la compilation de adminer
|
||||
tags: compile
|
||||
shell: |
|
||||
php /usr/share/adminer/compile.php
|
||||
mv /usr/share/adminer/adminer-*.php /usr/share/adminer/adminer.php
|
||||
echo "{{ alias }}" | tee /etc/apache2/conf-available/adminer.conf
|
||||
a2enconf adminer.conf
|
||||
notify: restart apache
|
||||
|
||||
- name: Message d'information
|
||||
tags: msg
|
||||
debug: msg="Adminer sera accessible depuis l'adresse http://10.121.38.206/adminer.php"
|
||||
|
||||
- name: On démarre MariaDB
|
||||
tags: mariadb
|
||||
service:
|
||||
name: mysql
|
||||
state: started
|
||||
|
||||
- name: Création de la BDD bdarbre
|
||||
tags: bdarbre
|
||||
mysql_db:
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||
name: bdarbre
|
||||
|
||||
- name: Création de l'utilisateur slam
|
||||
tags: user
|
||||
mysql_user:
|
||||
name: slam
|
||||
password: Azerty1+
|
||||
priv: '*.*:ALL,GRANT'
|
||||
state: present
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||
|
||||
- name: Création du dossier DokuWiki
|
||||
tags: createfile
|
||||
file:
|
||||
path: /root/dokuwiki
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: copie du fichier script d'install de dokuwiki
|
||||
tags: sh
|
||||
copy:
|
||||
src: dokuwiki.sh
|
||||
dest: /root/dokuwiki
|
||||
|
||||
- name: On rend exécutable le script d'install
|
||||
tags: chmod
|
||||
file:
|
||||
path: /root/dokuwiki/dokuwiki.sh
|
||||
mode: 0755
|
||||
|
||||
- name: exécution du script d'install de dokuwiki
|
||||
tags: exec
|
||||
command: bash /root/dokuwiki/dokuwiki.sh
|
||||
|
||||
- name: Message d'information pour dokuwiki
|
||||
tags: msg2
|
||||
debug: msg="Le dokuwiki devra être installer depuis l'adresse http://10.121.38.206/doku/install.php"
|
Loading…
x
Reference in New Issue
Block a user