summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Saulnier <fantom@fedoraproject.org>2018-11-02 19:27:36 +0100
committerMatthieu Saulnier <fantom@fedoraproject.org>2018-11-02 19:27:36 +0100
commit390dcf354f4d137e9e1b17426184c6c8ba25b055 (patch)
tree82b90126beee8afa3ee3a73204eca5b6dca266fc
parentd98779664135c79f9692da14f898bdf0fbb3df9f (diff)
downloadplaybooks-ansible-390dcf354f4d137e9e1b17426184c6c8ba25b055.tar.gz
playbooks-ansible-390dcf354f4d137e9e1b17426184c6c8ba25b055.tar.xz
playbooks-ansible-390dcf354f4d137e9e1b17426184c6c8ba25b055.zip
Add development systemd unit files in clients role
-rw-r--r--roles/clients/files/apache-casper-site.service19
-rw-r--r--roles/clients/files/apache-cirrus.service19
-rw-r--r--roles/clients/files/apache-jays-site.service19
-rw-r--r--roles/clients/files/mariadb-casper-site.service22
-rw-r--r--roles/clients/files/mariadb-cirrus.service22
-rw-r--r--roles/clients/files/mariadb-jays-site.service22
-rw-r--r--roles/clients/files/memcached-casper-site.service15
-rw-r--r--roles/clients/files/memcached-cirrus.service15
-rw-r--r--roles/clients/files/memcached-jays-site.service15
-rw-r--r--roles/clients/files/php-fpm-casper-site.service18
-rw-r--r--roles/clients/files/php-fpm-cirrus.service18
-rw-r--r--roles/clients/files/php-fpm-jays-site.service18
-rw-r--r--roles/clients/tasks/config.yml40
13 files changed, 254 insertions, 8 deletions
diff --git a/roles/clients/files/apache-casper-site.service b/roles/clients/files/apache-casper-site.service
new file mode 100644
index 0000000..016d060
--- /dev/null
+++ b/roles/clients/files/apache-casper-site.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Apache HTTP Server Vhost Casper Blog
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i -p 127.0.0.1:8101:80 \
+ -v /contener/%p/var/www/html:/var/www/html:z \
+ -v /contener/%p/etc/httpd/conf.d:/etc/httpd/conf.d:Z \
+ -v /contener/%p/etc/pki/tls/private:/etc/pki/tls/private:Z \
+ -v /contener/%p/etc/pki/tls/certs:/etc/pki/tls/certs:Z \
+ -v /contener/%p/var/log/httpd:/var/log/httpd:Z \
+ -v /contener/php-fpm-casper-site/run/php-fpm:/run/php-fpm:z \
+ apache-single:2.4.27-1
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/apache-cirrus.service b/roles/clients/files/apache-cirrus.service
new file mode 100644
index 0000000..7c1b6ce
--- /dev/null
+++ b/roles/clients/files/apache-cirrus.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Apache HTTP Server Vhost Cirrus
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i -p 127.0.0.1:8102:80 \
+ -v /contener/%p/var/www/html:/var/www/html:z \
+ -v /contener/%p/etc/httpd/conf.d:/etc/httpd/conf.d:Z \
+ -v /contener/%p/etc/pki/tls/private:/etc/pki/tls/private:Z \
+ -v /contener/%p/etc/pki/tls/certs:/etc/pki/tls/certs:Z \
+ -v /contener/%p/var/log/httpd:/var/log/httpd:Z \
+ -v /contener/php-fpm-cirrus/run/php-fpm:/run/php-fpm:z \
+ apache-single:2.4.27-1
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/apache-jays-site.service b/roles/clients/files/apache-jays-site.service
new file mode 100644
index 0000000..444ce3f
--- /dev/null
+++ b/roles/clients/files/apache-jays-site.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Apache HTTP Server Vhost Jay Blog
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i -p 127.0.0.1:8103:443 \
+ -v /contener/%p/var/www/html:/var/www/html:z \
+ -v /contener/%p/etc/httpd/conf.d:/etc/httpd/conf.d:Z \
+ -v /contener/%p/etc/pki/tls/private:/etc/pki/tls/private:Z \
+ -v /contener/%p/etc/pki/tls/certs:/etc/pki/tls/certs:Z \
+ -v /contener/%p/var/log/httpd:/var/log/httpd:Z \
+ -v /contener/php-fpm-jays-site/run/php-fpm:/run/php-fpm:z \
+ apache-single:2.4.27-1
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/mariadb-casper-site.service b/roles/clients/files/mariadb-casper-site.service
new file mode 100644
index 0000000..3723b7b
--- /dev/null
+++ b/roles/clients/files/mariadb-casper-site.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Mariadb Server Casper Site
+After=docker.service
+
+[Service]
+Restart=always
+EnvironmentFile=/etc/%p.env
+ExecStart=/usr/bin/docker run -i \
+ -e MYSQL_USER \
+ -e MYSQL_PASSWORD \
+ -e MYSQL_DATABASE \
+ -e MYSQL_ROOT_PASSWORD \
+ -v /contener/%p/var/lib/mysql/data:/var/lib/mysql/data:Z \
+ -v /contener/%p/etc/my.cnf.d:/etc/my.cnf.d:Z \
+ -v /contener/%p/var/log/mariadb:/var/log/mariadb:Z \
+ -v /contener/%p/run/mariadb:/run/mariadb:z \
+ mariadb:10.1.26-3
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/mariadb-cirrus.service b/roles/clients/files/mariadb-cirrus.service
new file mode 100644
index 0000000..c2b3ebc
--- /dev/null
+++ b/roles/clients/files/mariadb-cirrus.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Mariadb Server Cirrus
+After=docker.service
+
+[Service]
+Restart=always
+EnvironmentFile=/etc/%p.env
+ExecStart=/usr/bin/docker run -i \
+ -e MYSQL_USER \
+ -e MYSQL_PASSWORD \
+ -e MYSQL_DATABASE \
+ -e MYSQL_ROOT_PASSWORD \
+ -v /contener/%p/var/lib/mysql/data:/var/lib/mysql/data:Z \
+ -v /contener/%p/etc/my.cnf.d:/etc/my.cnf.d:Z \
+ -v /contener/%p/var/log/mariadb:/var/log/mariadb:Z \
+ -v /contener/%p/run/mariadb:/run/mariadb:z \
+ mariadb:10.1.26-3
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/mariadb-jays-site.service b/roles/clients/files/mariadb-jays-site.service
new file mode 100644
index 0000000..623873e
--- /dev/null
+++ b/roles/clients/files/mariadb-jays-site.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Mariadb Server Jay Site
+After=docker.service
+
+[Service]
+Restart=always
+EnvironmentFile=/etc/%p.env
+ExecStart=/usr/bin/docker run -i \
+ -e MYSQL_USER \
+ -e MYSQL_PASSWORD \
+ -e MYSQL_DATABASE \
+ -e MYSQL_ROOT_PASSWORD \
+ -v /contener/%p/var/lib/mysql/data:/var/lib/mysql/data:Z \
+ -v /contener/%p/etc/my.cnf.d:/etc/my.cnf.d:Z \
+ -v /contener/%p/var/log/mariadb:/var/log/mariadb:Z \
+ -v /contener/%p/run/mariadb:/run/mariadb:z \
+ mariadb:10.1.26-1
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/memcached-casper-site.service b/roles/clients/files/memcached-casper-site.service
new file mode 100644
index 0000000..a02d59a
--- /dev/null
+++ b/roles/clients/files/memcached-casper-site.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Memcached Server Casper Site
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i --dns 208.67.222.222 \
+ -v /contener/%p/etc/memcached.d:/etc/memcached.d:Z \
+ -v /contener/%p/var/run/memcached:/var/run/memcached:z \
+ memcached:1.5.7-2
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/memcached-cirrus.service b/roles/clients/files/memcached-cirrus.service
new file mode 100644
index 0000000..076a136
--- /dev/null
+++ b/roles/clients/files/memcached-cirrus.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Memcached Server Cirrus
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i --dns 208.67.222.222 \
+ -v /contener/%p/etc/memcached.d:/etc/memcached.d:Z \
+ -v /contener/%p/var/run/memcached:/var/run/memcached:z \
+ memcached:1.5.7-2
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/memcached-jays-site.service b/roles/clients/files/memcached-jays-site.service
new file mode 100644
index 0000000..121b1c2
--- /dev/null
+++ b/roles/clients/files/memcached-jays-site.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Memcached Server Jays Site
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i --dns 208.67.222.222 \
+ -v /contener/%p/etc/memcached.d:/etc/memcached.d:Z \
+ -v /contener/%p/var/run/memcached:/var/run/memcached:z \
+ memcached:1.5.7-2
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/php-fpm-casper-site.service b/roles/clients/files/php-fpm-casper-site.service
new file mode 100644
index 0000000..c91bec2
--- /dev/null
+++ b/roles/clients/files/php-fpm-casper-site.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=PHP-FPM Server Casper Site
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i --dns 208.67.222.222 \
+ -v /contener/%p/etc/php-fpm.d:/etc/php-fpm.d:Z \
+ -v /contener/%p/run/php-fpm:/run/php-fpm:z \
+ -v /contener/%p/var/log/php-fpm:/var/log/php-fpm:Z \
+ -v /contener/apache-casper-site/var/www/html:/var/www/html:z \
+ -v /contener/mariadb-casper-site/run/mariadb:/run/mariadb:z \
+ php-fpm:5.6.30-3
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/php-fpm-cirrus.service b/roles/clients/files/php-fpm-cirrus.service
new file mode 100644
index 0000000..9796ad2
--- /dev/null
+++ b/roles/clients/files/php-fpm-cirrus.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=PHP-FPM Server Cirrus
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i --dns 208.67.222.222 \
+ -v /contener/%p/etc/php-fpm.d:/etc/php-fpm.d:Z \
+ -v /contener/%p/run/php-fpm:/run/php-fpm:z \
+ -v /contener/%p/var/log/php-fpm:/var/log/php-fpm:Z \
+ -v /contener/apache-cirrus/var/www/html:/var/www/html:z \
+ -v /contener/mariadb-cirrus/run/mariadb:/run/mariadb:z \
+ php-fpm:7.2.9-3
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/files/php-fpm-jays-site.service b/roles/clients/files/php-fpm-jays-site.service
new file mode 100644
index 0000000..3d5d1ee
--- /dev/null
+++ b/roles/clients/files/php-fpm-jays-site.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=PHP-FPM Server Jay Site
+After=docker.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/docker run -i --dns 208.67.222.222 \
+ -v /contener/%p/etc/php-fpm.d:/etc/php-fpm.d:Z \
+ -v /contener/%p/run/php-fpm:/run/php-fpm:z \
+ -v /contener/%p/var/log/php-fpm:/var/log/php-fpm:Z \
+ -v /contener/apache-jays-site/var/www/html:/var/www/html:z \
+ -v /contener/mariadb-jays-site/run/mariadb:/run/mariadb:z \
+ php-fpm:5.6.30-3
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/clients/tasks/config.yml b/roles/clients/tasks/config.yml
index 6a823f7..fe67236 100644
--- a/roles/clients/tasks/config.yml
+++ b/roles/clients/tasks/config.yml
@@ -1,20 +1,44 @@
-- name: Installation des unités systemd
+- name: Installation des unités systemd divers
copy:
src: "{{ item }}"
dest: /etc/systemd/system/
mode: 0644
with_items:
- capslock-led-heartbeat.service
- - arp-poisoning-eno1.service
- - arp-poisoning-enp6s0.service
- - arp-watcher-eno1.service
- - arp-watcher-enp6s0.service
- - passerelle-dump-eno1.service
- - passerelle-dump-enp6s0.service
- - passerelle-dump-virbr0.service
- dnf-makecache.timer
notify: reload systemd
+- name: Installation des unités systemd de monitoring
+ copy:
+ src: "{{ item[0] }}-{{ item[1] }}.service"
+ dest: /etc/systemd/system/
+ mode: 0644
+ with_nested:
+ - [ 'arp-poisoning', 'arp-watcher' ]
+ - [ 'eno1', 'enp6s0' ]
+ notify: reload systemd
+
+- name: Installation des unités systemd de capture
+ copy:
+ src: "passerelle-dump-{{ item }}.service"
+ dest: /etc/systemd/system/
+ mode: 0644
+ with_items:
+ - eno1
+ - enp6s0
+ - virbr0
+ notify: reload systemd
+
+- name: Installation des unités systemd de dev
+ copy:
+ src: "{{ item[0] }}-{{ item[1] }}.service"
+ dest: /etc/systemd/system/
+ mode: 0644
+ with_nested:
+ - [ 'apache', 'mariadb', 'memcached', 'php-fpm' ]
+ - [ 'casper-site', 'cirrus', 'jays-site' ]
+ notify: reload systemd
+
- name: Configuration leds de dracut
copy:
src: led_modules.conf