modif nfs-server
This commit is contained in:
parent
acb722461c
commit
17618a8c8e
@ -5,6 +5,6 @@ Ce rôle :
|
||||
* installe **nfs-server**
|
||||
* copie le fichier de configuration **exports** pour exporter le répertoire **/home/wordpress**
|
||||
* relance le service **nfs-server**
|
||||
|
||||
* décompresse wordpress
|
||||
### Objectif
|
||||
Le répertoire **/home/wordpress** est exporté par **nfs** sur le réseau **n-dmz-db**
|
||||
|
@ -1,18 +1,77 @@
|
||||
---
|
||||
- name: installation des paquets
|
||||
apt:
|
||||
name:
|
||||
- nfs-kernel-server
|
||||
state: latest
|
||||
- name: 00 - cree repertoire wordpress pour export nfs
|
||||
file:
|
||||
path: /exports/wordpress
|
||||
state: directory
|
||||
|
||||
- name: copie exports pour partage nfs wordpress
|
||||
copy:
|
||||
src: exports
|
||||
dest: /etc
|
||||
- name: 05 - Install nfs-server
|
||||
apt:
|
||||
name: nfs-server
|
||||
state: present
|
||||
|
||||
- name: redemarrage du service rpcbind requis pour le service nfs
|
||||
shell: service rpcbind restart
|
||||
- name: 10 - creation fichier exports nfs
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/exports
|
||||
block: |
|
||||
/exports/wordpress 192.168.56.0/255.255.255.0 (rw,no_root_squash,subtree_check)
|
||||
|
||||
- name: redemarrage du service nfs-kernel-server
|
||||
shell: service nfs-kernel-server restart
|
||||
|
||||
- name: 15 - Recupere wordpress.tar.gz
|
||||
get_url:
|
||||
url: "https://fr.wordpress.org/latest-fr_FR.tar.gz"
|
||||
dest: /tmp/wordpress-6.1.1-fr_FR.tar.gz
|
||||
|
||||
- name: 20 - decompresse wordpress
|
||||
unarchive:
|
||||
src: /tmp/wordpress-6.1.1-fr_FR.tar.gz
|
||||
dest: /exports/
|
||||
remote_src: yes
|
||||
|
||||
- name: 22 - change owner et group pour repertoire wordpress
|
||||
file:
|
||||
path: /exports/wordpress
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: www-data
|
||||
group: www-data
|
||||
|
||||
- name: 30 - genere fichier de config wordpress
|
||||
copy:
|
||||
src: /exports/wordpress/wp-config-sample.php
|
||||
dest: /exports/wordpress/wp-config.php
|
||||
remote_src: yes
|
||||
|
||||
- name: 35 - ajuste variable dbname dans fichier de config wp-config.php
|
||||
replace:
|
||||
path: /exports/wordpress/wp-config.php
|
||||
regexp: "votre_nom_de_bdd"
|
||||
replace: "wordpressdb"
|
||||
backup: yes
|
||||
|
||||
|
||||
- name: 40 ajuste variable dbusername dans fichier de config wp-config.php
|
||||
replace:
|
||||
path: /exports/wordpress/wp-config.php
|
||||
regexp: "votre_utilisateur_de_bdd"
|
||||
replace: "wordpressuser"
|
||||
backup: yes
|
||||
|
||||
- name: 45 - ajuste variable mdp dans fichier de config wp-config.php
|
||||
replace:
|
||||
path: /exports/wordpress/wp-config.php
|
||||
regexp: "votre_mdp_de_bdd"
|
||||
replace: "wordpresspasswd"
|
||||
backup: yes
|
||||
|
||||
- name: 50 - ajuste hostname fichier wp-config.php
|
||||
replace:
|
||||
path: /exports/wordpress/wp-config.php
|
||||
regexp: "localhost"
|
||||
replace: "192.168.102.253"
|
||||
backup: yes
|
||||
|
||||
- name: 55 - relance nfs
|
||||
service:
|
||||
name: nfs-server
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user