- name: "Add Ansible repository" apt_repository: repo: "ppa:ansible/ansible" state: present when: - ansible_facts['distribution'] == "Ubuntu" - name: "Add apt key for Signal" apt_key: state: present keyserver: keyserver.ubuntu.com id: 93C4A3FD7BB9C367 when: - ansible_facts['distribution'] == "Debian" - name: "Add Ansible repository" apt_repository: repo: "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" state: present when: - ansible_facts['distribution_release'] == "buster" - name: "Install Packages" apt: state: present name: "{{ ansible_packages }}" - name: "Get the Proxmox Ansible inventory" ansible.builtin.get_url: url: "https://github.com/xezpeleta/Ansible-Proxmox-inventory/raw/master/proxmox.py" dest: "/etc/ansible/{{ ansible_inventory }}.py" mode: "0777" - name: "Copy the ansible config" ansible.builtin.template: src: "ansible.cfg.j2" dest: "/etc/ansible/ansible.cfg" mode: "0644" - name: "Copy the inventory config" ansible.builtin.template: src: "{{ ansible_inventory }}.json.j2" dest: "/etc/ansible/{{ ansible_inventory }}.json" mode: "0644"