[PATCH 8/8] move mirrorlist task to be a role

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 files/mirrorlist/mirrorlist-server.conf       | 44 ------------------
 files/mirrorlist/mm-authorized_key            |  1 -
 files/mirrorlist/mm_sync_data                 |  4 --
 files/mirrorlist/supervisord.conf             | 67 ---------------------------
 handlers/restart_services.yml                 |  3 --
 playbooks/groups/mirrorlist.yml               |  2 +-
 roles/mirrorlist/files/mirrorlist-server.conf | 44 ++++++++++++++++++
 roles/mirrorlist/files/mm-authorized_key      |  1 +
 roles/mirrorlist/files/mm_sync_data           |  4 ++
 roles/mirrorlist/files/supervisord.conf       | 67 +++++++++++++++++++++++++++
 roles/mirrorlist/tasks/main.yml               | 48 +++++++++++++++++++
 tasks/mirrorlist.yml                          | 48 -------------------
 12 files changed, 165 insertions(+), 168 deletions(-)
 delete mode 100644 files/mirrorlist/mirrorlist-server.conf
 delete mode 100644 files/mirrorlist/mm-authorized_key
 delete mode 100755 files/mirrorlist/mm_sync_data
 delete mode 100644 files/mirrorlist/supervisord.conf
 create mode 100644 roles/mirrorlist/files/mirrorlist-server.conf
 create mode 100644 roles/mirrorlist/files/mm-authorized_key
 create mode 100755 roles/mirrorlist/files/mm_sync_data
 create mode 100644 roles/mirrorlist/files/supervisord.conf
 create mode 100644 roles/mirrorlist/tasks/main.yml
 delete mode 100644 tasks/mirrorlist.yml

diff --git a/files/mirrorlist/mirrorlist-server.conf b/files/mirrorlist/mirrorlist-server.conf
deleted file mode 100644
index 1ee87bc..0000000
--- a/files/mirrorlist/mirrorlist-server.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-Alias /mirrorlists /var/lib/mirrormanager/mirrorlists/
-Alias /publiclist /var/lib/mirrormanager/mirrorlists/publiclist/
-Alias /static /var/lib/mirrormanager/mirrorlists/static/
-
-<Directory /var/lib/mirrormanager/mirrorlists>
-        Options Indexes FollowSymLinks
-        ExpiresActive On
-        ExpiresDefault "modification plus 1 day"
-</Directory>
-
-WSGIDaemonProcess mirrorlist user=apache processes=45 threads=1 display-name=mirrorlist maximum-requests=1000
-
-WSGIScriptAlias /metalink /usr/share/mirrormanager/mirrorlist-server/mirrorlist_client.wsgi
-WSGIScriptAlias /mirrorlist /usr/share/mirrormanager/mirrorlist-server/mirrorlist_client.wsgi
-
-# Set this if you do not have a Reverse Proxy (HTTP Accelerator) that
-# is in front of your application server running this code.
-# SetEnv mirrorlist_client.noreverseproxy 1
-
-<Location /mirrorlist>
-    WSGIProcessGroup mirrorlist
-    <IfModule mod_authz_core.c>
-        # Apache 2.4
-        Require all granted
-    </IfModule>
-    <IfModule !mod_authz_core.c>
-        # Apache 2.2
-        Order deny,allow
-        Allow from all
-    </IfModule>
-</Location>
-
-<Location /metalink>
-    WSGIProcessGroup mirrorlist
-    <IfModule mod_authz_core.c>
-        # Apache 2.4
-        Require all granted
-    </IfModule>
-    <IfModule !mod_authz_core.c>
-        # Apache 2.2
-        Order deny,allow
-        Allow from all
-    </IfModule>
-</Location>
diff --git a/files/mirrorlist/mm-authorized_key b/files/mirrorlist/mm-authorized_key
deleted file mode 100644
index bef6a55..0000000
--- a/files/mirrorlist/mm-authorized_key
+++ /dev/null
@@ -1 +0,0 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA1+Mq0V8RPuCZrjsSz2y56tVR+hykwoYSodhs6ivqkuf16PHo1Aq2PR+I7xnxnJ/fqF20UEV4bmRFs9k4y/QnMOwi90O32vC3WZmfLfoY9S9dzUYXXOYy0lQZPMjmB+yOYZhhGIu2HTc4/CHKjVpCUZKHXwgkouEwsAEHQI86TrepvPwt5GrmAeZjcRp8T3maaFlRf8UFgcajF9ztgiEnBpWBEKaemtUtQ/g9cr/SwNMT3GK+M4qMVaXkuTCeiKwqxueZmTgn76aQ11sfoWYi1lVCyYt02iMDoBLaLERbwBLt3WpY/l3tQaZiPVoRPDH2EQb6v/XISsXNsqGtnc8APfhkVniURNwW/Qz8eXhpnd7GlU90iWPExvGo/Eaj2cNemgiNZH7/U7OKe3/7Li+IpPDhLCfJ8ue7Nqn+2uqhEWvzZXvamzcvEg89PBbgrdHDvJqVLnfsMDuDEo93KZ2pCfTGmjbYjbV3nnArhimLjkkb2E86489F09p65e4AoZw3HFgeW8yA3ecXtXd9FmYYkL0urT1AZFuJ/9B364h4gOqUt0oO7aW0vqhS1hW+7brIJ2DzM/vn90ONk8JVt1T3DvmgmVLxtuo1wu1PkDtekZNtJPGuGzvt5TYDjGPwZzrkYdYazLow3NMCyrhV6oNm8sxuZCLxeyZdM83Q7xty5nM= toshio@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
diff --git a/files/mirrorlist/mm_sync_data b/files/mirrorlist/mm_sync_data
deleted file mode 100755
index e48bdc7..0000000
--- a/files/mirrorlist/mm_sync_data
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-rsync -az --delete-delay --delay-updates --delete mirrormanager@bapp02:/var/lib/mirrormanager/ /var/lib/mirrormanager/
-kill -HUP $(cat /var/run/mirrormanager/mirrorlist_server.pid)
diff --git a/files/mirrorlist/supervisord.conf b/files/mirrorlist/supervisord.conf
deleted file mode 100644
index 2183276..0000000
--- a/files/mirrorlist/supervisord.conf
+++ /dev/null
@@ -1,67 +0,0 @@
-
-[supervisord]
-http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
-;http_port=127.0.0.1:9001  ; (alternately, ip_address:port specifies AF_INET)
-;sockchmod=0700              ; AF_UNIX socketmode (AF_INET ignore, default 0700)
-;sockchown=nobody.nogroup     ; AF_UNIX socket uid.gid owner (AF_INET ignores)
-;umask=022                   ; (process file creation umask;default 022)
-logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
-logfile_maxbytes=50MB       ; (max main logfile bytes b4 rotation;default 50MB)
-logfile_backups=10          ; (num of main logfile rotation backups;default 10)
-loglevel=info               ; (logging level;default info; others: debug,warn)
-pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
-nodaemon=false              ; (start in foreground if true;default false)
-minfds=1024                 ; (min. avail startup file descriptors;default 1024)
-minprocs=200                ; (min. avail process descriptors;default 200)
-
-;nocleanup=true              ; (don't clean up tempfiles at start;default false)
-;http_username=user          ; (default is no username (open system))
-;http_password=123           ; (default is no password (open system))
-;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
-;user=chrism                 ; (default is current user, required if root)
-;directory=/tmp              ; (default is not to cd during start)
-;environment=KEY=value       ; (key value pairs to add to environment)
-
-[supervisorctl]
-serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL  for a unix socket
-;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
-;username=chris              ; should be same as http_username if set
-;password=123                ; should be same as http_password if set
-;prompt=mysupervisor         ; cmd line prompt (default "supervisor")
-
-; The below sample program section shows all possible program subsection values,
-; create one or more 'real' program: sections to be able to control them under
-; supervisor.
-
-;[program:theprogramname]
-;command=/bin/cat            ; the program (relative uses PATH, can take args)
-;priority=999                ; the relative start priority (default 999)
-;autostart=true              ; start at supervisord start (default: true)
-;autorestart=true            ; retstart at unexpected quit (default: true)
-;startsecs=10                ; number of secs prog must stay running (def. 10)
-;startretries=3              ; max # of serial start failures (default 3)
-;exitcodes=0,2               ; 'expected' exit codes for process (default 0,2)
-;stopsignal=QUIT             ; signal used to kill process (default TERM)
-;stopwaitsecs=10             ; max num secs to wait before SIGKILL (default 10)
-;user=chrism                 ; setuid to this UNIX account to run the program
-;log_stdout=true             ; if true, log program stdout (default true)
-;log_stderr=true             ; if true, log program stderr (def false)
-;logfile=/var/log/cat.log    ; child log path, use NONE for none; default AUTO
-;logfile_maxbytes=1MB        ; max # logfile bytes b4 rotation (default 50MB)
-;logfile_backups=10          ; # of logfile backups (default 10)
-
-[program:mirrorlist_server]
-command=/usr/share/mirrormanager/mirrorlist-server/mirrorlist_server.py
-priority=1
-autostart=true
-autorestart=true
-startsecs=10
-startretries=5
-stopsignal=TERM
-stopwaitsecs=10
-user=mirrormanager
-log_stderr=true
-log_stdout=true
-logfile=/var/log/mirrormanager/mirrorlist-server.log
-logfile_maxbytes=50MB
-logfile_backups=10
diff --git a/handlers/restart_services.yml b/handlers/restart_services.yml
index e11a2c7..23aa481 100644
--- a/handlers/restart_services.yml
+++ b/handlers/restart_services.yml
@@ -83,9 +83,6 @@
 - name: restart sshd
   action: service name=sshd state=restarted
 
-- name: restart supervisord
-  action: service name=supervisord state=restarted
-
 - name: restart xinetd
   action: service name=xinetd state=restarted
 
diff --git a/playbooks/groups/mirrorlist.yml b/playbooks/groups/mirrorlist.yml
index 5763f58..f824d6b 100644
--- a/playbooks/groups/mirrorlist.yml
+++ b/playbooks/groups/mirrorlist.yml
@@ -44,6 +44,7 @@
   - nagios_client
   - geoip
   - fas_client
+  - mirrorlist
 
   tasks:
   # this is how you include other task lists
@@ -57,7 +58,6 @@
   - include: $tasks/sudo.yml
   - include: $tasks/apache.yml
   - include: $tasks/mod_wsgi.yml
-  - include: $tasks/mirrorlist.yml
 
 
   handlers:
diff --git a/roles/mirrorlist/files/mirrorlist-server.conf b/roles/mirrorlist/files/mirrorlist-server.conf
new file mode 100644
index 0000000..1ee87bc
--- /dev/null
+++ b/roles/mirrorlist/files/mirrorlist-server.conf
@@ -0,0 +1,44 @@
+Alias /mirrorlists /var/lib/mirrormanager/mirrorlists/
+Alias /publiclist /var/lib/mirrormanager/mirrorlists/publiclist/
+Alias /static /var/lib/mirrormanager/mirrorlists/static/
+
+<Directory /var/lib/mirrormanager/mirrorlists>
+        Options Indexes FollowSymLinks
+        ExpiresActive On
+        ExpiresDefault "modification plus 1 day"
+</Directory>
+
+WSGIDaemonProcess mirrorlist user=apache processes=45 threads=1 display-name=mirrorlist maximum-requests=1000
+
+WSGIScriptAlias /metalink /usr/share/mirrormanager/mirrorlist-server/mirrorlist_client.wsgi
+WSGIScriptAlias /mirrorlist /usr/share/mirrormanager/mirrorlist-server/mirrorlist_client.wsgi
+
+# Set this if you do not have a Reverse Proxy (HTTP Accelerator) that
+# is in front of your application server running this code.
+# SetEnv mirrorlist_client.noreverseproxy 1
+
+<Location /mirrorlist>
+    WSGIProcessGroup mirrorlist
+    <IfModule mod_authz_core.c>
+        # Apache 2.4
+        Require all granted
+    </IfModule>
+    <IfModule !mod_authz_core.c>
+        # Apache 2.2
+        Order deny,allow
+        Allow from all
+    </IfModule>
+</Location>
+
+<Location /metalink>
+    WSGIProcessGroup mirrorlist
+    <IfModule mod_authz_core.c>
+        # Apache 2.4
+        Require all granted
+    </IfModule>
+    <IfModule !mod_authz_core.c>
+        # Apache 2.2
+        Order deny,allow
+        Allow from all
+    </IfModule>
+</Location>
diff --git a/roles/mirrorlist/files/mm-authorized_key b/roles/mirrorlist/files/mm-authorized_key
new file mode 100644
index 0000000..bef6a55
--- /dev/null
+++ b/roles/mirrorlist/files/mm-authorized_key
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA1+Mq0V8RPuCZrjsSz2y56tVR+hykwoYSodhs6ivqkuf16PHo1Aq2PR+I7xnxnJ/fqF20UEV4bmRFs9k4y/QnMOwi90O32vC3WZmfLfoY9S9dzUYXXOYy0lQZPMjmB+yOYZhhGIu2HTc4/CHKjVpCUZKHXwgkouEwsAEHQI86TrepvPwt5GrmAeZjcRp8T3maaFlRf8UFgcajF9ztgiEnBpWBEKaemtUtQ/g9cr/SwNMT3GK+M4qMVaXkuTCeiKwqxueZmTgn76aQ11sfoWYi1lVCyYt02iMDoBLaLERbwBLt3WpY/l3tQaZiPVoRPDH2EQb6v/XISsXNsqGtnc8APfhkVniURNwW/Qz8eXhpnd7GlU90iWPExvGo/Eaj2cNemgiNZH7/U7OKe3/7Li+IpPDhLCfJ8ue7Nqn+2uqhEWvzZXvamzcvEg89PBbgrdHDvJqVLnfsMDuDEo93KZ2pCfTGmjbYjbV3nnArhimLjkkb2E86489F09p65e4AoZw3HFgeW8yA3ecXtXd9FmYYkL0urT1AZFuJ/9B364h4gOqUt0oO7aW0vqhS1hW+7brIJ2DzM/vn90ONk8JVt1T3DvmgmVLxtuo1wu1PkDtekZNtJPGuGzvt5TYDjGPwZzrkYdYazLow3NMCyrhV6oNm8sxuZCLxeyZdM83Q7xty5nM= toshio@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
diff --git a/roles/mirrorlist/files/mm_sync_data b/roles/mirrorlist/files/mm_sync_data
new file mode 100755
index 0000000..e48bdc7
--- /dev/null
+++ b/roles/mirrorlist/files/mm_sync_data
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+rsync -az --delete-delay --delay-updates --delete mirrormanager@bapp02:/var/lib/mirrormanager/ /var/lib/mirrormanager/
+kill -HUP $(cat /var/run/mirrormanager/mirrorlist_server.pid)
diff --git a/roles/mirrorlist/files/supervisord.conf b/roles/mirrorlist/files/supervisord.conf
new file mode 100644
index 0000000..2183276
--- /dev/null
+++ b/roles/mirrorlist/files/supervisord.conf
@@ -0,0 +1,67 @@
+
+[supervisord]
+http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
+;http_port=127.0.0.1:9001  ; (alternately, ip_address:port specifies AF_INET)
+;sockchmod=0700              ; AF_UNIX socketmode (AF_INET ignore, default 0700)
+;sockchown=nobody.nogroup     ; AF_UNIX socket uid.gid owner (AF_INET ignores)
+;umask=022                   ; (process file creation umask;default 022)
+logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
+logfile_maxbytes=50MB       ; (max main logfile bytes b4 rotation;default 50MB)
+logfile_backups=10          ; (num of main logfile rotation backups;default 10)
+loglevel=info               ; (logging level;default info; others: debug,warn)
+pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
+nodaemon=false              ; (start in foreground if true;default false)
+minfds=1024                 ; (min. avail startup file descriptors;default 1024)
+minprocs=200                ; (min. avail process descriptors;default 200)
+
+;nocleanup=true              ; (don't clean up tempfiles at start;default false)
+;http_username=user          ; (default is no username (open system))
+;http_password=123           ; (default is no password (open system))
+;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
+;user=chrism                 ; (default is current user, required if root)
+;directory=/tmp              ; (default is not to cd during start)
+;environment=KEY=value       ; (key value pairs to add to environment)
+
+[supervisorctl]
+serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL  for a unix socket
+;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
+;username=chris              ; should be same as http_username if set
+;password=123                ; should be same as http_password if set
+;prompt=mysupervisor         ; cmd line prompt (default "supervisor")
+
+; The below sample program section shows all possible program subsection values,
+; create one or more 'real' program: sections to be able to control them under
+; supervisor.
+
+;[program:theprogramname]
+;command=/bin/cat            ; the program (relative uses PATH, can take args)
+;priority=999                ; the relative start priority (default 999)
+;autostart=true              ; start at supervisord start (default: true)
+;autorestart=true            ; retstart at unexpected quit (default: true)
+;startsecs=10                ; number of secs prog must stay running (def. 10)
+;startretries=3              ; max # of serial start failures (default 3)
+;exitcodes=0,2               ; 'expected' exit codes for process (default 0,2)
+;stopsignal=QUIT             ; signal used to kill process (default TERM)
+;stopwaitsecs=10             ; max num secs to wait before SIGKILL (default 10)
+;user=chrism                 ; setuid to this UNIX account to run the program
+;log_stdout=true             ; if true, log program stdout (default true)
+;log_stderr=true             ; if true, log program stderr (def false)
+;logfile=/var/log/cat.log    ; child log path, use NONE for none; default AUTO
+;logfile_maxbytes=1MB        ; max # logfile bytes b4 rotation (default 50MB)
+;logfile_backups=10          ; # of logfile backups (default 10)
+
+[program:mirrorlist_server]
+command=/usr/share/mirrormanager/mirrorlist-server/mirrorlist_server.py
+priority=1
+autostart=true
+autorestart=true
+startsecs=10
+startretries=5
+stopsignal=TERM
+stopwaitsecs=10
+user=mirrormanager
+log_stderr=true
+log_stdout=true
+logfile=/var/log/mirrormanager/mirrorlist-server.log
+logfile_maxbytes=50MB
+logfile_backups=10
diff --git a/roles/mirrorlist/tasks/main.yml b/roles/mirrorlist/tasks/main.yml
new file mode 100644
index 0000000..6fb68af
--- /dev/null
+++ b/roles/mirrorlist/tasks/main.yml
@@ -0,0 +1,48 @@
+---
+# tasklist for setting up the mirrorlist app components
+# create mirrormanager user
+- name: add mirrormanager user - uid 441
+  user: name=mirrormanager uid=441 state=present home=/home/mirrormanager createhome=yes
+
+- name: install supervisor and mirrormanager
+  yum: pkg=$item state=installed
+  with_items:
+  - supervisor
+  - mirrormanager
+  tags:
+  - packages
+
+# mirrormanager user ssh key(s)
+- name: add authorized_keys for mirrormanager
+  authorized_key: key="{{ item }}" user=mirrormanager state=present
+  with_file:
+  - mm-authorized_key
+
+# install mirrorlist-server.conf apache config
+- name: mirrorlist-server apache conf
+  copy: src=mirrorlist-server.conf dest=/etc/httpd/conf.d/mirrorlist-server.conf
+  notify:
+  - restart apache
+  tags:
+  - config
+
+# nuke mirrormanager.conf so that it doesn't start up
+- name: kill /etc/httpd/conf.d/mirrrormanager.conf
+  copy: 'content="#blanked on purpose" dest=/etc/httpd/conf.d/mirrormanager.conf'
+  notify:
+  - restart apache
+  tags:
+  - config
+
+# selinux policy - mirrormanager - put in place - for the sockfile
+# 
+
+# setup and configure supervisord
+- name: /etc/supervisord.conf
+  copy: src=supervisord.conf dest=/etc/supervisord.conf mode=0644
+  notify:
+  - restart supervisord
+
+- name: enable supervisord
+  service: name=supervisord state=started enabled=yes
+
diff --git a/tasks/mirrorlist.yml b/tasks/mirrorlist.yml
deleted file mode 100644
index 0bc4cf8..0000000
--- a/tasks/mirrorlist.yml
+++ /dev/null
@@ -1,48 +0,0 @@
----
-# tasklist for setting up the mirrorlist app components
-# create mirrormanager user
-- name: add mirrormanager user - uid 441
-  user: name=mirrormanager uid=441 state=present home=/home/mirrormanager createhome=yes
-
-- name: install supervisor and mirrormanager
-  yum: pkg=$item state=installed
-  with_items:
-  - supervisor
-  - mirrormanager
-  tags:
-  - packages
-
-# mirrormanager user ssh key(s)
-- name: add authorized_keys for mirrormanager
-  authorized_key: key="{{ item }}" user=mirrormanager state=present
-  with_file:
-  - $files/mirrorlist/mm-authorized_key
-
-# install mirrorlist-server.conf apache config
-- name: mirrorlist-server apache conf
-  copy: src=$files/mirrorlist/mirrorlist-server.conf dest=/etc/httpd/conf.d/mirrorlist-server.conf
-  notify:
-  - restart apache
-  tags:
-  - config
-
-# nuke mirrormanager.conf so that it doesn't start up
-- name: kill /etc/httpd/conf.d/mirrrormanager.conf
-  copy: 'content="#blanked on purpose" dest=/etc/httpd/conf.d/mirrormanager.conf'
-  notify:
-  - restart apache
-  tags:
-  - config
-
-# selinux policy - mirrormanager - put in place - for the sockfile
-# 
-
-# setup and configure supervisord
-- name: /etc/supervisord.conf
-  copy: src=$files/mirrorlist/supervisord.conf dest=/etc/supervisord.conf mode=0644
-  notify:
-  - restart supervisord
-
-- name: enable supervisord
-  service: name=supervisord state=started enabled=yes
-
-- 
1.8.3.1

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure





[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux