--- - block: - name: Create group '{{ pve_sd_group }}' group: name: "{{ pve_sd_group }}" state: present - name: Create user '{{ pve_sd_user }}' user: comment: pve_sd name: "{{ pve_sd_user }}" group: "{{ pve_sd_group }}" groups: "{{ pve_sd_extra_groups | join(',') }}" - name: Upgrade python dependencies pip: name: "{{ item }}" virtualenv: "{{ pve_sd_virtualenv }}" virtualenv_command: "{{ pve_sd_virtualenv_command }}" extra_args: --upgrade umask: "{{ pve_sd_virtualenv_umask | default(omit) }}" loop: - pip - setuptools - name: Install dependencies pip: name: "{{ item }}" virtualenv: "{{ pve_sd_virtualenv }}" virtualenv_command: "{{ pve_sd_virtualenv_command }}" umask: "{{ pve_sd_virtualenv_umask | default(omit) }}" environment: TMPDIR: /opt/python3/tmp loop: "{{ pve_sd_packages_extra }}" - name: Install PVE SD pip: name: "{{ item }}" virtualenv: "{{ pve_sd_virtualenv }}" virtualenv_command: "{{ pve_sd_virtualenv_command }}" umask: "{{ pve_sd_virtualenv_umask | default(omit) }}" loop: "{{ __pve_sd_packages }}" - name: Make PVE SD binaries executable file: name: "{{ pve_sd_virtualenv }}/bin/{{ item }}" mode: 0755 loop: "{{ __pve_sd_binaries }}" - name: Deploy PVE SD bin wrappers template: src: usr/local/bin/pve-sd-wrapper.j2 dest: "/usr/local/bin/{{ item }}" owner: root group: root mode: 0755 loop: "{{ __pve_sd_binaries }}" become: True become_user: root - block: - name: Write environment file template: src: etc/sysconfig/pve_sd.j2 dest: /etc/sysconfig/pve_sd mode: 0600 notify: __pve_sd_restart - name: Write timer file template: src: etc/systemd/system/pve_sd.timer.j2 dest: /etc/systemd/system/pve_sd.timer mode: 0644 notify: __pve_sd_restart - name: Write service file template: src: etc/systemd/system/pve_sd.service.j2 dest: /etc/systemd/system/pve_sd.service mode: 0644 notify: __pve_sd_restart - name: Ensure PVE SD timer is up and running service: name: pve_sd.timer daemon_reload: yes enabled: yes state: "{{ pve_sd_service_stopped | ternary('stopped', 'started', 'started') }}" become: True become_user: root