diff --git a/files/mirrorlist/supervisord.conf b/files/mirrorlist/supervisord.conf new file mode 100644 index 0000000000..2dfd08f424 --- /dev/null +++ b/files/mirrorlist/supervisord.conf @@ -0,0 +1,64 @@ + +[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 + diff --git a/playbooks/groups/mirrorlist.yml b/playbooks/groups/mirrorlist.yml index 54046cfd46..78f4e07f60 100644 --- a/playbooks/groups/mirrorlist.yml +++ b/playbooks/groups/mirrorlist.yml @@ -43,6 +43,9 @@ - include: $tasks/rkhunter.yml - include: $tasks/denyhosts.yml - include: $tasks/nagios_client.yml + - include: $tasks/mod_wsgi.yml + - include: $tasks/mirrorlist.yml + handlers: diff --git a/tasks/mirrorlist.yml b/tasks/mirrorlist.yml index 8c3a07a7cf..d4618e8c8f 100644 --- a/tasks/mirrorlist.yml +++ b/tasks/mirrorlist.yml @@ -1,7 +1,5 @@ --- # tasklist for setting up the mirrorlist app components -# install supervisor -# install mirrormanager - name: install supervisor and mirrormanager yum: pkg=$item state=installed with_items: @@ -28,3 +26,13 @@ # 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 +