Adding self installation command for fabrica

This commit is contained in:
2021-03-23 10:47:39 +01:00
parent 740a8de4a2
commit b360760855
120 changed files with 301 additions and 164 deletions

View 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

View 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 }}"

View 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

View 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

View 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

View 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

View 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

View 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

View 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