--- - name: Create louketo group group: name: "{{ louketo_group }}" state: present - name: Create louketo user user: name: "{{ louketo_user }}" group: "{{ louketo_group }}" create_home: no system: yes - name: Create louketo directories file: path: "{{ item }}" state: directory owner: "{{ louketo_user }}" group: "{{ louketo_group }}" loop: - "{{ louketo_install_path }}" - "{{ louketo_config_path }}" - name: Check if file with current installed version exists stat: path: "{{ louketo_install_path }}/VERSION" register: stat_version_file - name: Get content of file with current installed version slurp: src: "{{ louketo_install_path }}/VERSION" register: slurp_version_file when: stat_version_file.stat.exists - name: Download louketo unarchive: src: "{{ louketo_archive_url }}" dest: "{{ louketo_install_path }}" remote_src: true extra_opts: - '--strip-components=1' owner: "{{ louketo_user }}" group: "{{ louketo_group }}" when: (not stat_version_file.stat.exists) or (slurp_version_file.content | b64decode != louketo_version) - name: Copy louketo systemd-service template: src: louketo@.service.j2 dest: /etc/systemd/system/louketo@.service - name: Reload systemd-deamon service: daemon-reload: yes - include_tasks: instance.yml loop: "{{ louketo_instances }}" - name: Create file for saving current installed version copy: content: "{{ louketo_version }}" dest: "{{ louketo_install_path }}/VERSION" owner: "{{ louketo_user }}" group: "{{ louketo_group }}" when: (not stat_version_file.stat.exists) or (slurp_version_file.content | b64decode != louketo_version)