Tests Goss
This commit is contained in:
38
AP4/onfarbo41/ansible/roles/onfarbo/README.md
Normal file
38
AP4/onfarbo41/ansible/roles/onfarbo/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
20
AP4/onfarbo41/ansible/roles/onfarbo/files/dokuwiki.sh
Executable file
20
AP4/onfarbo41/ansible/roles/onfarbo/files/dokuwiki.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
chemin=/var/www/html/doku
|
||||
|
||||
apt install -y apache2 php php-mbstring php-gd php-xml
|
||||
cd /root
|
||||
[ -r dokuwiki-stable.tgz ] || wget http://depl/store/dokuwiki-stable.tgz
|
||||
|
||||
if [ $? !=0 ]; then
|
||||
echo "$0 : erreurwget" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
tar xvfz dokuwiki-stable.tgz
|
||||
[ -d "${chemin}" ] || mkdir "${chemin}"
|
||||
|
||||
cp -a dokuwiki-2020-07-29/* "${chemin}"
|
||||
cd "${chemin}"
|
||||
chown -R root:root .
|
||||
chmod -R 755 .
|
||||
chown -R www-data:www-data data lib conf
|
||||
exit 0
|
4
AP4/onfarbo41/ansible/roles/onfarbo/handlers/main.yml
Normal file
4
AP4/onfarbo41/ansible/roles/onfarbo/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: restart apache
|
||||
service:
|
||||
name: apache2
|
||||
state: restarted
|
83
AP4/onfarbo41/ansible/roles/onfarbo/tasks/main.yml
Normal file
83
AP4/onfarbo41/ansible/roles/onfarbo/tasks/main.yml
Normal file
@@ -0,0 +1,83 @@
|
||||
- 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"
|
1
AP4/onfarbo41/ansible/roles/onfarbo/vars/main.yml
Normal file
1
AP4/onfarbo41/ansible/roles/onfarbo/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
alias: "Alias /adminer.php /usr/share/adminer/adminer.php"
|
Reference in New Issue
Block a user