- name: install tt-rss become: yes pacman: name: tt-rss state: present - name: "Ensure database is present" become: yes mysql_db: name: "{{ ttrss_db_name }}" collation: utf8_general_ci encoding: utf8 state: present register: ttrss_database_creation - name: import DATA in database in case of creation become: yes mysql_db: name: "{{ ttrss_db_name }}" state: import target: "{{ttrss_SQl_target_file}}" when: ttrss_database_creation.changed == true and ttrss_SQl_target_file is defined - name: "Ensure db user is present" become: yes mysql_user: name: "{{ ttrss_db_user }}" host: localhost password: "{{ ttrss_db_password }}" priv: "{{ ttrss_db_name }}.*:ALL" state: present - name: link tt-rss folder to WWW become: yes file: src: /usr/share/webapps/tt-rss dest: "{{ttrss_install_path}}" state: link - name: Ensure config.php is present template: src: config.php.j2 dest: /etc/webapps/tt-rss/config.php become: yes - name: copy failtoban config template: src: fail2ban/tt-rss.local.j2 dest: /etc/fail2ban/jail.d/tt-rss.local notify: restart fail2ban become: yes - name: enable daemon service: name: tt-rss # required. Name of the service. enabled: true # not required. Whether the service should start on boot. B(At least one of state and enabled are required.) state: started # not required. choices: reloaded;restarted;started;stopped. C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. C(restarted) will always bounce the service. C(reloaded) will always reload. B(At least one of state and enabled are required.) Note that reloaded will start the service if it is not already started, even if your chosen init system wouldn't normally. become: yes