Ansible onfarbo
This commit is contained in:
parent
9fefca1301
commit
79bf771c49
2060
AP4/onfarbo41/adminer-4.7.9.php
Normal file
2060
AP4/onfarbo41/adminer-4.7.9.php
Normal file
File diff suppressed because one or more lines are too long
4
AP4/onfarbo41/hosts
Normal file
4
AP4/onfarbo41/hosts
Normal file
@ -0,0 +1,4 @@
|
||||
[localhost]
|
||||
|
||||
[onfabro]
|
||||
onfabrovr
|
9
AP4/onfarbo41/playbook.yml
Normal file
9
AP4/onfarbo41/playbook.yml
Normal file
@ -0,0 +1,9 @@
|
||||
- name: Playbook pour onfarbo
|
||||
hosts: onfabro
|
||||
connection: local
|
||||
become: yes
|
||||
become_method: sudo
|
||||
become_user: root
|
||||
|
||||
roles:
|
||||
- onfarbo
|
38
AP4/onfarbo41/roles/onfarbo/README.md
Normal file
38
AP4/onfarbo41/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).
|
2
AP4/onfarbo41/roles/onfarbo/defaults/main.yml
Normal file
2
AP4/onfarbo41/roles/onfarbo/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for onfarbo
|
4
AP4/onfarbo41/roles/onfarbo/handlers/main.yml
Normal file
4
AP4/onfarbo41/roles/onfarbo/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- name: restart apache
|
||||
service:
|
||||
name: apache2
|
||||
state: restarted
|
56
AP4/onfarbo41/roles/onfarbo/tasks/main.yml
Normal file
56
AP4/onfarbo41/roles/onfarbo/tasks/main.yml
Normal 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
|
1
AP4/onfarbo41/roles/onfarbo/vars/main.yml
Normal file
1
AP4/onfarbo41/roles/onfarbo/vars/main.yml
Normal file
@ -0,0 +1 @@
|
||||
alias: "Alias /adminer.php /usr/share/adminer/adminer.php"
|
Loading…
x
Reference in New Issue
Block a user