Playbook onfarbo41

This commit is contained in:
IDEZ Ugo 2022-02-09 16:05:53 +01:00
parent e428c52cbe
commit ca000e0b57
15 changed files with 117 additions and 88 deletions

View File

@ -0,0 +1,8 @@
- name: Playbook pour adminer
hosts: onfarbo
become: yes
become_method: sudo
become_user: root
roles:
- adminer

View File

@ -0,0 +1,8 @@
- name: Playbook pour la BDD
hosts: onfarbo
become: yes
become_method: sudo
become_user: root
roles:
- db

View File

@ -0,0 +1,8 @@
- name: Playbook pour le dokuwiki
hosts: onfarbo
become: yes
become_method: sudo
become_user: root
roles:
- dokuwiki

View File

@ -1,4 +1,2 @@
[localhost]
[onfarbo]
onfarbo41

View File

@ -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

View 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"

View File

@ -0,0 +1,4 @@
- name: restart apache
service:
name: apache2
state: restarted

View 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

View File

@ -0,0 +1,4 @@
- name: restart apache
service:
name: apache2
state: restarted

View 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"

View File

@ -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"