--- - name: Set local facts set_fact: vcdrender_cache: /var/cache/vcd-render - name: Install host requisites dnf: name: python3-lxml state: latest - name: Copy webapp sources synchronize: src: checkouts/vcd-render/ dest: /var/lib/vcd-render delete: true group: no owner: no - name: Setup webapp python requirements pip: name: - beautifulsoup4 - flask - vcdvcd virtualenv: /var/lib/vcd-render/venv virtualenv_site_packages: true - name: Create uwsgi worker user and group user: name: uwsgi-vcdrender create_home: no group: uwsgi password: '!' shell: /sbin/nologin system: yes - name: Template webapp config template: src: vcdrender.cfg.j2 dest: /var/lib/vcd-render/vcdrender_prod.cfg owner: uwsgi-vcdrender group: root mode: 0660 - name: Copy uwsgi config copy: src: uwsgi-vcdrender.ini dest: /etc/uwsgi.d/vcdrender.ini owner: uwsgi-vcdrender group: uwsgi mode: 440 - name: Enable uwsgi systemd socket systemd: daemon-reload: yes name: uwsgi-app@vcdrender.socket enabled: yes state: started # FIXME the socket doesn't seem to work properly - name: Enable uwsgi systemd service systemd: daemon-reload: yes name: uwsgi-app@vcdrender.service enabled: yes - name: Copy vcdrender cache dir tmpfiles.d config template: src: tmpfiles-vcdrender.conf.j2 dest: /etc/tmpfiles.d/vcdrender.conf owner: root group: root mode: 0644 register: vcdrender_tmpfiles_config - name: Kick systemd tmpfiles service to create cache dir command: systemd-tmpfiles --create when: vcdrender_tmpfiles_config is changed