--- - hosts: all become: true tasks: - name: kea-dhcp4-server et kea-ctrl-agent ... apt: name: - kea-dhcp4-server - kea-dhcp6-server - kea-ctrl-agent state: present - name: change adresse IP dans /etc/kea/kea-ctrl-agent.conf ansible.builtin.replace: path: /etc/kea/kea-ctrl-agent.conf regexp: '"http-host": "127.0.0.1",' replace: '"http-host": "{{ srv_ip }}",' backup: yes - name: relance service kea-ctrl-agent ansible.builtin.service: name: kea-ctrl-agent state: restarted enabled: yes - name: genere ikea-dhcp4.conf a partir de la template ansible.builtin.template: src: kea-dhcp4.conf.j2 dest: /etc/kea/kea-dhcp4.conf backup: yes - name: relance service kea-dhcp4-server ansible.builtin.service: name: kea-dhcp4-server state: restarted enabled: yes