Adding self installation command for fabrica
This commit is contained in:
20
.packer/provisioning/playbooks/common-appli.yml
Normal file
20
.packer/provisioning/playbooks/common-appli.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Preparation des serveurs d'applications web
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install eole-web
|
||||
apt:
|
||||
name: eole-web
|
||||
state: present
|
||||
|
37
.packer/provisioning/playbooks/dc.yml
Normal file
37
.packer/provisioning/playbooks/dc.yml
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
- name: Configure Seth Server
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- apt:
|
||||
name: make
|
||||
|
||||
- apt:
|
||||
name: git
|
||||
|
||||
- apt:
|
||||
name: python-ldap
|
||||
|
||||
- git:
|
||||
repo: 'https://forge.cadoles.com/afornerot/cadolesldap.git'
|
||||
dest: /tmp/cadolesldap
|
||||
|
||||
- name: Run 'install' for cadolesldap
|
||||
make:
|
||||
chdir: /tmp/cadolesldap
|
||||
target: install
|
||||
|
||||
- name: Cleanup
|
||||
apt:
|
||||
name: make
|
||||
state: absent
|
13
.packer/provisioning/playbooks/dns.yml
Normal file
13
.packer/provisioning/playbooks/dns.yml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Configure DNS Serverless
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- apk:
|
||||
name: nsd, unbound
|
29
.packer/provisioning/playbooks/dokuwiki.yml
Normal file
29
.packer/provisioning/playbooks/dokuwiki.yml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Preparation des serveurs d'applications web
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Setting EOLE Dev apt repository
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Installing dokuwiki
|
||||
apt:
|
||||
name:
|
||||
- eole-dokuwiki
|
||||
- dokuwiki-apps
|
||||
state: present
|
||||
|
||||
- name: Back to normal EOLE apt repository
|
||||
command: Query-Auto
|
51
.packer/provisioning/playbooks/dolibarr.yml
Normal file
51
.packer/provisioning/playbooks/dolibarr.yml
Normal file
@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Installation Dolibarr Server
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install mariadb
|
||||
apt:
|
||||
name:
|
||||
- mariadb-server
|
||||
- python-mysqldb
|
||||
- apache2
|
||||
- php
|
||||
- php-mysql
|
||||
- openssl
|
||||
- php-ldap
|
||||
- php-mcrypt
|
||||
- php-intl
|
||||
- php-zip
|
||||
state: present
|
||||
|
||||
- name: Create a new database with name 'dolibarr'
|
||||
mysql_db:
|
||||
name: dolibarr
|
||||
state: present
|
||||
|
||||
- name: Create mysql user
|
||||
mysql_user:
|
||||
name: dolibarr
|
||||
password: '36f3igH9f5TPooZIBY99oA=='
|
||||
priv: 'dolibarr.*:ALL,GRANT'
|
||||
state: present
|
||||
|
||||
- name: Download Dolibarr
|
||||
get_url:
|
||||
url: https://sourceforge.net/projects/dolibarr/files/Dolibarr%20installer%20for%20Debian-Ubuntu%20%28DoliDeb%29/10.0.1/dolibarr_10.0.1-4_all.deb
|
||||
dest: /tmp/dolibarr_10.0.1.deb
|
||||
checksum: sha1:74a9bb2ac282715f80ad454cb04ad51ef60de264
|
||||
|
||||
- name: Install dolibarr
|
||||
apt:
|
||||
deb: /tmp/dolibarr_10.0.1.deb
|
26
.packer/provisioning/playbooks/eole/amon.yml
Normal file
26
.packer/provisioning/playbooks/eole/amon.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install amon module package
|
||||
apt:
|
||||
name: eole-amon-all
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Change hostname
|
||||
hostname:
|
||||
name: amon272
|
85
.packer/provisioning/playbooks/eole/eole.yml
Normal file
85
.packer/provisioning/playbooks/eole/eole.yml
Normal file
@ -0,0 +1,85 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Stop and disable unattended-upgrades service
|
||||
service:
|
||||
name: unattended-upgrades
|
||||
state: stopped
|
||||
enabled: no
|
||||
|
||||
- name: Stop apt-daily service
|
||||
service:
|
||||
name: apt-daily
|
||||
state: stopped
|
||||
enabled: no
|
||||
|
||||
- name: Stop apt-daily.timer service
|
||||
service:
|
||||
name: apt-daily.timer
|
||||
state: stopped
|
||||
enabled: no
|
||||
|
||||
- name: Stop apt-daily-upgrade service
|
||||
service:
|
||||
name: apt-daily-upgrade
|
||||
state: stopped
|
||||
enabled: no
|
||||
|
||||
- pause:
|
||||
seconds: 30
|
||||
|
||||
- name: Install a EOLE Keyring from the internet.
|
||||
apt:
|
||||
deb: http://eole.ac-dijon.fr/eole/pool/main/e/eole-keyring/eole-archive-keyring_2020.05.12-1_all.deb
|
||||
retries: 5
|
||||
delay: 5
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Adding EOLE main repository
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-{{ EOLE_VERSION }} main cloud
|
||||
state: present
|
||||
|
||||
- name: Adding EOLE security repository
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-{{ EOLE_VERSION }}-security main cloud
|
||||
state: present
|
||||
|
||||
- name: Adding EOLE updates repository
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-{{ EOLE_VERSION }}-updates main cloud
|
||||
state: present
|
||||
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install chromium browser on 2.7.2
|
||||
apt:
|
||||
name: chromium-browser
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
when: EOLE_VERSION == "2.7.2"
|
||||
|
||||
- name: Install eole-server and eole-exim-pkg
|
||||
apt:
|
||||
name: eole-server,eole-exim-pkg
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
36
.packer/provisioning/playbooks/eole/lemonldap.yml
Normal file
36
.packer/provisioning/playbooks/eole/lemonldap.yml
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Add an Apt signing key, for Cadoles
|
||||
apt_key:
|
||||
url: https://vulcain.cadoles.com/cadoles.gpg
|
||||
state: present
|
||||
|
||||
- name: Adding Cadoles devel repository
|
||||
apt_repository:
|
||||
repo: deb https://vulcain.cadoles.com 2.7.2-stable main
|
||||
state: present
|
||||
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install lemonldap package
|
||||
apt:
|
||||
name: eole-lemonldap
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Change hostname
|
||||
hostname:
|
||||
name: lemonldap272
|
36
.packer/provisioning/playbooks/eole/minio.yml
Normal file
36
.packer/provisioning/playbooks/eole/minio.yml
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Add an Apt signing key, for Cadoles
|
||||
apt_key:
|
||||
url: https://vulcain.cadoles.com/cadoles.gpg
|
||||
state: present
|
||||
|
||||
- name: Adding Cadoles devel repository
|
||||
apt_repository:
|
||||
repo: deb https://vulcain.cadoles.com 2.7.2-dev main
|
||||
state: present
|
||||
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install minio package
|
||||
apt:
|
||||
name: eole-minio
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Change hostname
|
||||
hostname:
|
||||
name: minio272
|
109
.packer/provisioning/playbooks/eole/partitions.yml
Normal file
109
.packer/provisioning/playbooks/eole/partitions.yml
Normal file
@ -0,0 +1,109 @@
|
||||
---
|
||||
- name: Prepare data disk
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
vars:
|
||||
fsconf:
|
||||
vgn: "{{ lookup('env', 'vgname') }}"
|
||||
lvs: "{{ lookup('env', 'lvnames').split(' ') }}"
|
||||
szs: "{{ lookup('env', 'lvsizes').split(' ') }}"
|
||||
fss: "{{ lookup('env', 'lvfssys').split(' ') }}"
|
||||
mps: "{{ lookup('env', 'lvmntps').split(' ') }}"
|
||||
|
||||
tasks:
|
||||
|
||||
- name: GrowPart
|
||||
command: "growpart /dev/vda 4"
|
||||
environment:
|
||||
LC_ALL: C
|
||||
|
||||
- name: Resize main vg
|
||||
lvg:
|
||||
vg: "{{ fsconf.vgn }}"
|
||||
pvs: /dev/vda4
|
||||
pvresize: yes
|
||||
|
||||
- name: Create logical volumes.
|
||||
lvol:
|
||||
vg: "{{ fsconf.vgn }}"
|
||||
lv: "{{ item }}"
|
||||
size: "{{ fsconf.szs[idx] }}"
|
||||
active: yes
|
||||
force: no
|
||||
state: present
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Create filesystems
|
||||
filesystem:
|
||||
fstype: "{{ fsconf.fss[idx] }}"
|
||||
dev: "/dev/{{ fsconf.vgn }}/{{ item }}"
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Find what to backup
|
||||
stat:
|
||||
path: "{{ item }}"
|
||||
with_items: "{{ fsconf.mps }}"
|
||||
register: mountPoints
|
||||
|
||||
|
||||
- name: Create mount points
|
||||
file:
|
||||
path: "{{ fsconf.mps[idx] }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Create temporary mount points
|
||||
file:
|
||||
path: "/tmp{{ fsconf.mps[idx] }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Mount fs in temporary mount points
|
||||
command: mount /dev/{{ fsconf.vgn }}/"{{ item }}" "/tmp{{ fsconf.mps[idx] }}"
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Configure filesystems create entry in fstab
|
||||
mount:
|
||||
path: "{{ fsconf.mps[idx] }}"
|
||||
src: /dev/{{ fsconf.vgn }}/{{ item }}
|
||||
state: present
|
||||
fstype: "{{ fsconf.fss[idx] }}"
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Fill new mount points if exists
|
||||
become: true
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
synchronize:
|
||||
mode: push
|
||||
src: "{{ item.item }}/"
|
||||
dest: "/tmp{{ item.item }}/"
|
||||
times: yes
|
||||
perms: yes
|
||||
owner: yes
|
||||
group: yes
|
||||
links: yes
|
||||
recursive: yes
|
||||
with_items: "{{ mountPoints.results }}"
|
||||
when: item.stat.exists
|
||||
|
||||
|
81
.packer/provisioning/playbooks/eole/provision.yml
Normal file
81
.packer/provisioning/playbooks/eole/provision.yml
Normal file
@ -0,0 +1,81 @@
|
||||
---
|
||||
- name: Provision Cadoles Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name : Install One Context tool !
|
||||
apt:
|
||||
deb: https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context_5.8.0-1.deb
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name : Install JQ
|
||||
apt:
|
||||
name: jq
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name : Add cadoles context script
|
||||
command: mv /root/net-99-eole /etc/one-context.d/net-99-eole
|
||||
|
||||
- name: Make cadoles context script executable
|
||||
file:
|
||||
path: /etc/one-context.d/net-99-eole
|
||||
mode: '+x'
|
||||
|
||||
- name: Copy sshd_template to modif directory
|
||||
command: cp /usr/share/eole/creole/distrib/sshd_config /usr/share/eole/creole/modif/sshd_config
|
||||
|
||||
- name: Allow TCP Forwarding to ease GenConfig usage
|
||||
lineinfile:
|
||||
path: /usr/share/eole/creole/modif/sshd_config
|
||||
regexp: '^AllowTcpForwarding'
|
||||
line: 'AllowTcpForwarding yes'
|
||||
|
||||
- name: Gen_Patch
|
||||
command: gen_patch
|
||||
|
||||
- name: Update Hostname
|
||||
command: hostnamectl set-hostname eolebase272
|
||||
|
||||
- name: Cleanup
|
||||
apt:
|
||||
autoclean: yes
|
||||
autoremove: yes
|
||||
|
||||
- name: Disable gpm
|
||||
systemd:
|
||||
name: gpm
|
||||
enabled: no
|
||||
masked: yes
|
||||
|
||||
- name: Disable NUT Driver
|
||||
systemd:
|
||||
name: nut-driver
|
||||
enabled: no
|
||||
masked: yes
|
||||
|
||||
- name: Disable NUT Monitor
|
||||
systemd:
|
||||
name: nut-monitor
|
||||
enabled: no
|
||||
masked: yes
|
||||
|
||||
- name: FSTRIM
|
||||
command: fstrim -av
|
||||
|
||||
- name: Zero out the disk
|
||||
command: dd if=/dev/zero of=/mytempfile
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Cleaup zero file
|
||||
command: rm -rf /mytempfile
|
||||
|
||||
- name: Sync disk
|
||||
command: sync
|
26
.packer/provisioning/playbooks/eole/seth.yml
Normal file
26
.packer/provisioning/playbooks/eole/seth.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install seth module package
|
||||
apt:
|
||||
name: eole-seth-all
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Change hostname
|
||||
hostname:
|
||||
name: seth272
|
41
.packer/provisioning/playbooks/eole/tenjin.yml
Normal file
41
.packer/provisioning/playbooks/eole/tenjin.yml
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Add an Apt signing key, for Cadoles
|
||||
apt_key:
|
||||
url: https://vulcain.cadoles.com/cadoles.gpg
|
||||
state: present
|
||||
|
||||
- name: Adding Cadoles devel repository
|
||||
apt_repository:
|
||||
repo: deb https://vulcain.cadoles.com 2.7.2-stable main
|
||||
state: present
|
||||
|
||||
- name: Adding Cadoles Tenjin repository
|
||||
apt_repository:
|
||||
repo: deb https://vulcain.cadoles.com tenjin-2.7.2-stable main
|
||||
state: present
|
||||
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install Tenjin AD package
|
||||
apt:
|
||||
name: eole-seth-education
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Change hostname
|
||||
hostname:
|
||||
name: tenjin272
|
26
.packer/provisioning/playbooks/eole/zephir.yml
Normal file
26
.packer/provisioning/playbooks/eole/zephir.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Transform Ubuntu into an EOLE Server
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Update cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Install Zephir module package
|
||||
apt:
|
||||
name: eole-zephir-all
|
||||
environment:
|
||||
HTTP_PROXY: "{{ http_proxy }}"
|
||||
HTTPS_PROXY: "{{ https_proxy }}"
|
||||
http_proxy: "{{ http_proxy }}"
|
||||
https_proxy: "{{ https_proxy }}"
|
||||
|
||||
- name: Change hostname
|
||||
hostname:
|
||||
name: zephir272
|
67
.packer/provisioning/playbooks/get_conf_from_zephir.yml
Normal file
67
.packer/provisioning/playbooks/get_conf_from_zephir.yml
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
- name: Récupère la configuration depuis le Zéphir
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
vars:
|
||||
- zephir_server: "{{ lookup('env', 'zephir_server') }}"
|
||||
- zephir_login: "{{ lookup('env', 'zephir_login') }}"
|
||||
- zephir_password: "{{ lookup('env','zephir_password') }}"
|
||||
- code_rne: "{{ lookup('env','code_rne') }}"
|
||||
- zephir_id: "{{ lookup('env', 'zephir_id') }}"
|
||||
|
||||
tasks:
|
||||
- name: Installation de pexpect
|
||||
package:
|
||||
name: python-pexpect
|
||||
state: present
|
||||
|
||||
- name: Update CA-Certificats
|
||||
command: update-ca-certificates
|
||||
|
||||
- name: Enregistrement Zéphir
|
||||
|
||||
expect:
|
||||
command: /usr/bin/enregistrement_zephir
|
||||
responses:
|
||||
"(.*)Voulez-vous établir une configuration réseau minimale(.*)": "N"
|
||||
"(.*)Entrez l'adresse(.*)": "{{zephir_server}}"
|
||||
"(.*)Entrez votre login pour l'application Zéphir(.*)": "{{ zephir_login }}"
|
||||
"(.*)Mot de passe pour l'application Zéphir pour(.*)": "{{ zephir_password }}"
|
||||
"(.*)créer le serveur dans la base du serveur Zéphir(.*)": "N"
|
||||
"(.*)rien pour saisir directement un n° de serveur(.*)": "{{ code_rne }}"
|
||||
"(.*)entrez le n° identifiant le serveur l'application Zéphir(.*)": "{{ zephir_id }}"
|
||||
"(.*)matériel(.*)": ""
|
||||
"(.*)processeur(.*)": ""
|
||||
"(.*)disque dur(.*)": ""
|
||||
"(.*)continuer(.*)": "O"
|
||||
"(.*)Entrez le numéro de votre choix(.*)": "2"
|
||||
echo: yes
|
||||
timeout: 480
|
||||
|
||||
- pause:
|
||||
minutes: 1
|
||||
prompt: "Pause d'une minute pour finaliser l'enregistrement Zéphir"
|
||||
|
||||
- name: Cleaning EOLE main repository (avoid duplicate entry)
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-2.7.2 main cloud
|
||||
state: absent
|
||||
|
||||
- name: Cleaning EOLE security repository (avoid duplicate entry)
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-2.7.2-security main cloud
|
||||
state: absent
|
||||
|
||||
- name: Cleaning EOLE updates repository (avoid duplicate entry)
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-2.7.2-updates main cloud
|
||||
state: absent
|
||||
|
||||
- name: Cleaning EOLE repository (create clean entry)
|
||||
command: Query-Auto
|
33
.packer/provisioning/playbooks/hole.yml
Normal file
33
.packer/provisioning/playbooks/hole.yml
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Configure Pi-Hole Server
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- apt:
|
||||
name: curl
|
||||
|
||||
- apt:
|
||||
name: git
|
||||
|
||||
- git:
|
||||
repo: 'https://github.com/pi-hole/pi-hole.git'
|
||||
dest: /tmp/Pi-hole
|
||||
depth: 1
|
||||
|
||||
- name: Run 'install' for Pi-Hole
|
||||
shell: bash "/tmp/Pi-hole/automated install/basic-install.sh" --unattended
|
||||
|
||||
- name: Cleanup
|
||||
apt:
|
||||
name: make, curl, git
|
||||
state: absent
|
17
.packer/provisioning/playbooks/infra/cadoles.com/sso.yml
Normal file
17
.packer/provisioning/playbooks/infra/cadoles.com/sso.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Configure SSO Server
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Maj-Auto
|
||||
command: Maj-Auto
|
||||
|
||||
- apt:
|
||||
name: eole-lemonldap
|
||||
state: present
|
39
.packer/provisioning/playbooks/instance.yml
Normal file
39
.packer/provisioning/playbooks/instance.yml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Instance EOLE image
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Installation de pexpect
|
||||
package:
|
||||
name: python-pexpect
|
||||
state: present
|
||||
|
||||
- name: Instancier le module EOLE
|
||||
expect:
|
||||
command: /usr/bin/instance
|
||||
# Attention, les mots de passe sont en clairs dans le playbook !
|
||||
# Il serait préférable d'utiliser le mécanisme ansible_vault ici
|
||||
responses:
|
||||
"Nouveau mot de passe:":
|
||||
- "NotSoSecret;21"
|
||||
- "NotSoSecret;21"
|
||||
"Confirmation du mot de passe:":
|
||||
- "NotSoSecret;21"
|
||||
- "NotSoSecret;21"
|
||||
'\[non\]':
|
||||
- non
|
||||
'\[oui\]':
|
||||
- non
|
||||
'(.*)Un red(.)marrage(.*)\[oui\]':
|
||||
- non
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Désactivation du Maj-Auto
|
||||
command: /usr/share/eole/sbin/manage_schedule -d majauto
|
68
.packer/provisioning/playbooks/jorani.yml
Normal file
68
.packer/provisioning/playbooks/jorani.yml
Normal file
@ -0,0 +1,68 @@
|
||||
---
|
||||
- name: Installation Jorani
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install mariadb
|
||||
apt:
|
||||
name:
|
||||
- mariadb-server
|
||||
- python-mysqldb
|
||||
- unzip
|
||||
- apache2
|
||||
- php
|
||||
- openssl
|
||||
- php-ldap
|
||||
- libapache2-mod-php
|
||||
- php-pear
|
||||
- php-cgi
|
||||
- php-cli
|
||||
- php-common
|
||||
- php-fpm
|
||||
- php-gd
|
||||
- php-json
|
||||
- php-mysql
|
||||
- php-readline
|
||||
- php-curl
|
||||
- php-intl
|
||||
- php-mcrypt
|
||||
- php-xml
|
||||
- php-mbstring
|
||||
|
||||
state: present
|
||||
|
||||
- name: Create a new database with name 'jorani'
|
||||
mysql_db:
|
||||
name: jorani
|
||||
state: present
|
||||
|
||||
- name: Create mysql user
|
||||
mysql_user:
|
||||
name: jorani
|
||||
password: 'FWUiVANngFqcIvcY8C7XWA=='
|
||||
priv: 'jorani.*:ALL,GRANT'
|
||||
state: present
|
||||
|
||||
- name: Create directory Jorani
|
||||
ansible.builtin.file:
|
||||
path: /var/www/html/jorani
|
||||
state: directory
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: '0750'
|
||||
|
||||
- name: Download Jorani
|
||||
unarchive:
|
||||
src: https://github.com/bbalet/jorani/releases/download/v1.0.0/jorani-1.0.0.zip
|
||||
dest: /var/www/html/jorani/
|
||||
remote_src: yes
|
30
.packer/provisioning/playbooks/limesurvey.yml
Normal file
30
.packer/provisioning/playbooks/limesurvey.yml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Preparation des serveurs d'applications web
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Setting EOLE Dev apt repository
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Installing ninegate
|
||||
apt:
|
||||
name:
|
||||
- eole-limesurvey
|
||||
- limesurvey-apps
|
||||
state: present
|
||||
|
||||
- name: Back to normal EOLE apt repository
|
||||
command: Query-Auto
|
||||
|
30
.packer/provisioning/playbooks/nextcloud.yml
Normal file
30
.packer/provisioning/playbooks/nextcloud.yml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Preparation des serveurs d'applications web
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Setting EOLE Dev apt repository
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Installing Nextcloud
|
||||
apt:
|
||||
name:
|
||||
- eole-nextcloud
|
||||
- nextcloud-apps
|
||||
state: present
|
||||
|
||||
- name: Back to normal EOLE apt repository
|
||||
command: Query-Auto
|
||||
|
32
.packer/provisioning/playbooks/nineboard.yml
Normal file
32
.packer/provisioning/playbooks/nineboard.yml
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Preparation des serveurs d'applications web
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Setting EOLE Dev apt repository
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Installing ninegate
|
||||
apt:
|
||||
name:
|
||||
- eole-nineboard
|
||||
- nineboard-apps
|
||||
state: present
|
||||
|
||||
- name: Back to normal EOLE apt repository
|
||||
command: Query-Auto
|
||||
|
||||
- name: Generate patch
|
||||
command: gen_patch
|
29
.packer/provisioning/playbooks/ninegate.yml
Normal file
29
.packer/provisioning/playbooks/ninegate.yml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Configure Portal Server
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Setting EOLE Dev apt repository
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Installing ninegate
|
||||
apt:
|
||||
name:
|
||||
- eole-ninegate
|
||||
- ninegate-apps
|
||||
state: present
|
||||
|
||||
- name: Back to normal EOLE apt repository
|
||||
command: Query-Auto
|
29
.packer/provisioning/playbooks/piwigo.yml
Normal file
29
.packer/provisioning/playbooks/piwigo.yml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Preparation des serveurs d'applications web
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Setting EOLE Dev apt repository
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- name: Installing ninegate
|
||||
apt:
|
||||
name:
|
||||
- eole-piwigo
|
||||
- piwigo-apps
|
||||
state: present
|
||||
|
||||
- name: Back to normal EOLE apt repository
|
||||
command: Query-Auto
|
40
.packer/provisioning/playbooks/portal.yml
Normal file
40
.packer/provisioning/playbooks/portal.yml
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
- name: Configure Portal Server
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Maj-Auto
|
||||
command: Maj-Auto
|
||||
|
||||
- name: Query-Auto Dev
|
||||
expect:
|
||||
command: Query-Auto -D
|
||||
responses:
|
||||
'\[non\]':
|
||||
- "oui"
|
||||
echo: yes
|
||||
timeout: 900
|
||||
|
||||
- apt:
|
||||
name: eole-ninegate
|
||||
state: present
|
||||
|
||||
- apt:
|
||||
name: ninegate-apps
|
||||
state: present
|
||||
|
||||
- name: Query-Auto
|
||||
command: Query-Auto
|
||||
|
||||
- name: Reconfigure
|
||||
command: reconfigure
|
107
.packer/provisioning/playbooks/prepare_data_disk.yml
Normal file
107
.packer/provisioning/playbooks/prepare_data_disk.yml
Normal file
@ -0,0 +1,107 @@
|
||||
---
|
||||
- name: Prepare data disk
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
vars:
|
||||
fsconf:
|
||||
vgn: "{{ lookup('env', 'vgname') }}"
|
||||
lvs: "{{ lookup('env', 'lvnames').split(' ') }}"
|
||||
szs: "{{ lookup('env', 'lvsizes').split(' ') }}"
|
||||
fss: "{{ lookup('env', 'lvfssys').split(' ') }}"
|
||||
mps: "{{ lookup('env', 'lvmntps').split(' ') }}"
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Create the "datavg" Volume group.
|
||||
lvg:
|
||||
pvs: "/dev/vdb"
|
||||
vg: "{{ fsconf.vgn }}"
|
||||
pesize: "16"
|
||||
pv_options: '-Z y'
|
||||
force: no
|
||||
state: present
|
||||
|
||||
- name: Create logical volumes.
|
||||
lvol:
|
||||
vg: "datavg"
|
||||
lv: "{{ item }}"
|
||||
size: "{{ fsconf.szs[idx] }}"
|
||||
active: yes
|
||||
force: no
|
||||
state: present
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Create filesystems
|
||||
filesystem:
|
||||
fstype: "{{ fsconf.fss[idx] }}"
|
||||
dev: "/dev/datavg/{{ item }}"
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Find what to backup
|
||||
stat:
|
||||
path: "{{ item }}"
|
||||
with_items: "{{ fsconf.mps }}"
|
||||
register: mountPoints
|
||||
|
||||
|
||||
- name: Create mount points
|
||||
file:
|
||||
path: "{{ fsconf.mps[idx] }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Create temporary mount points
|
||||
file:
|
||||
path: "/tmp{{ fsconf.mps[idx] }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Mount fs in temporary mount points
|
||||
command: mount /dev/datavg/"{{ item }}" "/tmp{{ fsconf.mps[idx] }}"
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Configure filesystems create entry in fstab
|
||||
mount:
|
||||
path: "{{ fsconf.mps[idx] }}"
|
||||
src: /dev/datavg/{{ item }}
|
||||
state: present
|
||||
fstype: "{{ fsconf.fss[idx] }}"
|
||||
loop: "{{ fsconf.lvs }}"
|
||||
loop_control:
|
||||
index_var: idx
|
||||
|
||||
- name: Fill new mount points if exists
|
||||
become: true
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
synchronize:
|
||||
mode: push
|
||||
src: "{{ item.item }}/"
|
||||
dest: "/tmp{{ item.item }}/"
|
||||
times: yes
|
||||
perms: yes
|
||||
owner: yes
|
||||
group: yes
|
||||
links: yes
|
||||
recursive: yes
|
||||
with_items: "{{ mountPoints.results }}"
|
||||
when: item.stat.exists
|
||||
|
||||
|
73
.packer/provisioning/playbooks/prepare_disk.yml
Normal file
73
.packer/provisioning/playbooks/prepare_disk.yml
Normal file
@ -0,0 +1,73 @@
|
||||
---
|
||||
- name: Prepare disk
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
vars:
|
||||
ds: "{{ lookup('env', 'disk') }}"
|
||||
vg: "{{ lookup('env', 'vgname') }}"
|
||||
lv: "{{ lookup('env', 'lvname') }}"
|
||||
fs: "{{ lookup('env', 'fstype') }}"
|
||||
sz: "{{ lookup('env', 'size') }}"
|
||||
mp: "{{ lookup('env', 'mountp') }}"
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Create the volume group.
|
||||
lvg:
|
||||
pvs: "{{ ds }}"
|
||||
vg: "{{ vg }}"
|
||||
pesize: "16"
|
||||
pv_options: '-Z y'
|
||||
force: no
|
||||
state: present
|
||||
|
||||
- name: Create logical volume
|
||||
lvol:
|
||||
vg: "{{ vg }}"
|
||||
lv: "{{ lv }}"
|
||||
size: "{{ sz }}"
|
||||
active: yes
|
||||
force: no
|
||||
state: present
|
||||
|
||||
- name: Create filesystem
|
||||
filesystem:
|
||||
fstype: "ext4"
|
||||
dev: "/dev/{{ vg }}/{{ lv }}"
|
||||
opts: -cc
|
||||
|
||||
- name: Create temporary mount points
|
||||
file:
|
||||
path: "/tmp{{ mp }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Mount fs in temporary mount points
|
||||
command: mount /dev/"{{ vg }}"/"{{ lv }}" "/tmp{{ mp }}"
|
||||
|
||||
- name: Configure filesystems create entry in fstab
|
||||
mount:
|
||||
path: "{{ mp }}"
|
||||
src: /dev/{{ vg }}/{{ lv }}
|
||||
state: present
|
||||
fstype: "{{ fs }}"
|
||||
|
||||
- name: Fill new mount points if exists
|
||||
become: true
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
synchronize:
|
||||
mode: push
|
||||
src: "{{ mp }}/"
|
||||
dest: "/tmp{{ mp }}/"
|
||||
times: yes
|
||||
perms: yes
|
||||
owner: yes
|
||||
group: yes
|
||||
links: yes
|
||||
recursive: yes
|
66
.packer/provisioning/playbooks/syspass.yml
Normal file
66
.packer/provisioning/playbooks/syspass.yml
Normal file
@ -0,0 +1,66 @@
|
||||
---
|
||||
- name: Installation Syspass
|
||||
hosts: all
|
||||
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
|
||||
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
|
||||
|
||||
tasks:
|
||||
- name: Update package cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install mariadb
|
||||
apt:
|
||||
name:
|
||||
- mariadb-server
|
||||
- python-mysqldb
|
||||
- unzip
|
||||
- apache2
|
||||
- libapache2-mod-php
|
||||
- php-pear
|
||||
- php
|
||||
- php-cgi
|
||||
- php-cli
|
||||
- php-common
|
||||
- php-fpm
|
||||
- php-gd
|
||||
- php-json
|
||||
- php-mysql
|
||||
- php-readline
|
||||
- php-curl
|
||||
- php-intl
|
||||
- php-ldap
|
||||
- php-mcrypt
|
||||
- php-xml
|
||||
- php-mbstring
|
||||
state: present
|
||||
|
||||
- name: Create a new database with name 'syspass'
|
||||
mysql_db:
|
||||
name: syspass
|
||||
state: present
|
||||
|
||||
- name: Create mysql user
|
||||
mysql_user:
|
||||
name: spadmin
|
||||
password: '63ApD2E0xVJlNi9+hqsZUQ=='
|
||||
priv: 'syspass.*:ALL,GRANT'
|
||||
state: present
|
||||
|
||||
- name: Create directory syspass
|
||||
ansible.builtin.file:
|
||||
path: /var/www/html/syspass
|
||||
state: directory
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: '0750'
|
||||
|
||||
- name: Download Syspass
|
||||
unarchive:
|
||||
src: https://github.com/nuxsmin/sysPass/archive/3.2.1.zip
|
||||
dest: /var/www/html/syspass
|
||||
remote_src: yes
|
Reference in New Issue
Block a user