--- - name: get the encrypt_key ansible.builtin.command: cmd: cat /etc/consul/gossip.key register: gossip become: true changed_when: false - name: set the consul.json config file ansible.builtin.template: src: consul.json.j2 dest: /etc/consul/consul.json mode: 0600 owner: consul become: true