Ansible onfarbo

This commit is contained in:
IDEZ Ugo 2022-02-07 16:52:24 +01:00
parent 9fefca1301
commit 79bf771c49
8 changed files with 2174 additions and 0 deletions

File diff suppressed because one or more lines are too long

4
AP4/onfarbo41/hosts Normal file
View File

@ -0,0 +1,4 @@
[localhost]
[onfabro]
onfabrovr

View File

@ -0,0 +1,9 @@
- name: Playbook pour onfarbo
hosts: onfabro
connection: local
become: yes
become_method: sudo
become_user: root
roles:
- onfarbo

View 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).

View File

@ -0,0 +1,2 @@
---
# defaults file for onfarbo

View File

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

View File

@ -0,0 +1,56 @@
- 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

View File

@ -0,0 +1 @@
alias: "Alias /adminer.php /usr/share/adminer/adminer.php"