--- - name: instsall apt packages apt: name: graphite-web state: present - name: configure secret key lineinfile: path: /etc/graphite/local_settings.py regexp: '#?SECRET_KEY\s*=' line: "SECRET_KEY = '{{ graphite_web_secret_key }}'" - name: initialize database become: yes become_method: su become_user: "_graphite" become_flags: "-s /bin/bash" command: graphite-manage migrate --run-syncdb args: creates: /var/lib/graphite/graphite.db - name: fix sqlite database permissions file: path: /var/lib/graphite/graphite.db owner: "_graphite" group: "_graphite" mode: "0600" - name: check if uwsgi plugin python3 is installed assert: msg: "This role needs uwsgi with python3 plugin installed" that: - uwsgi_plugins is defined - "'python3' in uwsgi_plugins" - name: install uwsgi app vars: uwsgi_app: name: graphite content: "{{ lookup('template', 'uwsgi-app.ini.j2') }}" include_role: name: uwsgi/app - name: render nginx-vhost config template set_fact: graphite_web_nginx_vhost_content: "{{ lookup('template', 'nginx-vhost.conf.j2') }}" - name: install nginx vhost vars: nginx_vhost: name: graphite content: "{{ graphite_web_nginx_vhost_content }}" include_role: name: nginx/vhost