--- - name: Rancher directories become: yes ansible.builtin.file: state: directory path: "{{ item }}" mode: 0750 owner: root group: root loop: - '/etc/rancher' - '/etc/rancher/rke2' - name: Rancher config become: true ansible.builtin.template: src: rancher.config.yaml.j2 dest: /etc/rancher/rke2/config.yaml owner: root group: root mode: 0750 - name: Copy install script become: yes ansible.builtin.copy: src: get-rancher.sh dest: /usr/local/sbin/get-rancher.sh owner: root group: root mode: 0750 - name: Run install script become: yes ansible.builtin.command: cmd: /usr/local/sbin/get-rancher.sh - name: Enable rancherd become: yes ansible.builtin.service: name: rancherd state: restarted enabled: yes - debug: msg: 'Make sure to run `rancherd reset-admin` if this is a new cluster.'