#799 kinoite.fedoraproject.org: add site & build cronjob
Closed 2 years ago by darknao. Opened 2 years ago by darknao.
fedora-infra/ darknao/ansible kinoite  into  main

@@ -53,6 +53,8 @@ 

      when: master_sundries_node|bool

    - role: fedoraloveskde/build

      when: master_sundries_node|bool

+   - role: kinoite/build

+     when: master_sundries_node|bool

    - { role: rabbit/user,

        username: "sundries{{ env_suffix }}",

        when: master_sundries_node|bool and deployment_type == "stg" }

@@ -66,3 +66,6 @@ 

  

    - role: fedora-web/fedora.im

      website: fedora.im

+ 

+   - role: kinoite/website

+     website: kinoite.fedoraproject.org

@@ -1131,3 +1131,12 @@ 

      certbot: true

      tags:

      - fedora.im

+ 

+   - role: httpd/website

+     site_name: kinoite.fedoraproject.org

+     server_aliases:

+     - kinoite.stg.fedoraproject.org

+     sslonly: true

+     cert_name: "{{wildcard_cert_name}}"

+     tags:

+     - kinoite

@@ -0,0 +1,2 @@ 

+ MAILTO=web-members@fedoraproject.org

+ 35 * * * * apache /usr/local/bin/lock-wrapper synckinoite /usr/local/bin/synckinoite

@@ -0,0 +1,13 @@ 

+ #!/bin/bash

+ 

+ if [ ! -d  /srv/web/kinoite.fedoraproject.org/.git ]

+ then

+     /usr/bin/git clone -q https://pagure.io/fedora-kde/kinoite-site /srv/web/kinoite.fedoraproject.org

+ fi

+ 

+ cd /srv/web/kinoite.fedoraproject.org

+ 

+ /usr/bin/git clean -q -fdx || exit 1

+ /usr/bin/git reset -q --hard || exit 1

+ /usr/bin/git checkout -q production || exit 1

+ /usr/bin/git pull -q --ff-only || exit 1

@@ -0,0 +1,13 @@ 

+ #!/bin/bash

+ 

+ if [ ! -d  /srv/web/kinoite.fedoraproject.org/.git ]

+ then

+     /usr/bin/git clone -q https://pagure.io/fedora-kde/kinoite-site /srv/web/kinoite.fedoraproject.org

+ fi

+ 

+ cd /srv/web/kinoite.fedoraproject.org

+ 

+ /usr/bin/git clean -q -fdx || exit 1

+ /usr/bin/git reset -q --hard || exit 1

+ /usr/bin/git checkout -q staging || exit 1

+ /usr/bin/git pull -q --ff-only || exit 1

@@ -0,0 +1,48 @@ 

+ - name: Create directories

+   file:

+     state: directory

+     path: /srv/web/{{ item }}

+     owner: apache

+     group: apache

+     mode: 0755

+     setype: httpd_sys_content_t

+     seuser: system_u

+   with_items:

+   - kinoite.fedoraproject.org

+   tags:

+   - kinoite

+ 

+ - name: Copy synckinoite script (stg)

+   when: env == "staging"

+   copy:

+     src: synckinoite.stg.sh

+     dest: /usr/local/bin/synckinoite

+     owner: root

+     group: root

+     mode: 0755

+   tags:

+   - kinoite

+ 

+ - name: Copy synckinoite script (prod)

+   when: env == "production"

+   copy:

+     src: synckinoite.sh

+     dest: /usr/local/bin/synckinoite

+     owner: root

+     group: root

+     mode: 0755

+   tags:

+   - kinoite

+ 

+ - name: Install the synckinoite cron job

+   copy:

+     src: "{{ item }}.cron"

+     dest: /etc/cron.d/{{ item }}.cron

+     owner: root

+     group: root

+     mode: 0644

+   with_items:

+   - synckinoite

+   tags:

+   - kinoite

+   - cron

@@ -0,0 +1,1 @@ 

+ 40 * * * *  root /usr/bin/rsync --delete -a --no-owner --no-group --delete-excluded --exclude='.git*' sundries01::kinoite.fedoraproject.org/ /srv/web/kinoite.fedoraproject.org/

@@ -0,0 +1,8 @@ 

+ DocumentRoot /srv/web/kinoite.fedoraproject.org/public

+ 

+ AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript

+ 

+ FileETag MTime Size

+ 

+ ExpiresActive On

+ ExpiresDefault "access plus 30 minutes"

@@ -0,0 +1,20 @@ 

+ - name: Copy in the sync-kinoite cronjob

+   copy:

+     src: cron-sync-kinoite

+     dest: /etc/cron.d/sync-kinoite

+   tags:

+   - kinoite

+ 

+ - name: Copy some config files for {{ website }}

+   copy:

+     src: "{{ item }}"

+     dest: /etc/httpd/conf.d/{{ website }}/{{ item }}

+     owner: root

+     group: root

+     mode: 0644

+   with_items:

+   - kinoite.conf

+   notify:

+   - reload proxyhttpd

+   tags:

+   - kinoite

@@ -221,3 +221,11 @@ 

  gid = root

  read only = yes

  hosts allow = 10.3.160.0/255.255.224.0 192.168.0.0/255.255.0.0

+ 

+ [kinoite.fedoraproject.org]

+ comment = kinoite.fedoraproject.org

+ path = /srv/web/kinoite.fedoraproject.org

+ uid = root

+ gid = root

+ read only = yes

+ hosts allow = 10.3.160.0/255.255.224.0 192.168.0.0/255.255.0.0

@@ -221,3 +221,11 @@ 

  gid = root

  read only = yes

  hosts allow = 10.3.160.0/255.255.224.0 192.168.0.0/255.255.0.0

+ 

+ [kinoite.fedoraproject.org]

+ comment = kinoite.fedoraproject.org

+ path = /srv/web/kinoite.fedoraproject.org

+ uid = root

+ gid = root

+ read only = yes

+ hosts allow = 10.3.160.0/255.255.224.0 192.168.0.0/255.255.0.0