--- # Managing epoptes on 'client' role - name: Ensuring epoptes-client is installed apt: name: epoptes-client state: present - name: Getting epoptes server name shell: "curl http://{{ ansible_local.domain.serverfqdn }}:3000/epoptes-srv" register: epoptes_srv - name: Assure epoptes has the correct server lineinfile: path: /etc/default/epoptes-client regexp: '^SERVER=' line: "SERVER={{ epoptes_srv.stdout }}" insertafter: '^#SERVER' state: present register: changed_srv - name: Getting the certificate in case it was changed shell: /usr/sbin/epoptes-client -c when: changed_srv is changed notify: - reboot