- name: Git pull on python repositories become: false git: repo: "{{ git_url }}{{ item }}" dest: "{{ repo_dir }}{{ item }}" update: yes version: master loop: "{{ python_repos }}" - name: Install python-setuptools community.general.pacman: name: python-setuptools state: present - name: Install specified python requirements in indicated virtualenv ansible.builtin.pip: requirements: "{{ repo_dir }}{{ item }}/requirements.txt" virtualenv: "{{ repo_dir }}{{ item }}/venv" loop: "{{ python_repos }}" - name: Create python-meme-bot .env file become: false template: src: templates/.env.j2 dest: "{{ repo_dir }}{{ python_meme_bot }}/.env" - name: Create groupgardenbot .env file become: false template: src: templates/.env2.j2 dest: "{{ repo_dir }}{{ groupgardenbot }}/.env" - name: Create python systemd service files template: src: templates/python.service.j2 dest: "/etc/systemd/system/{{ item }}.service" loop: "{{ python_repos }}" - name: Enable and start python services ansible.builtin.service: name: "{{ item }}" enabled: yes state: started loop: "{{ python_repos }}"