main.yml 684 Bytes
---
  - name: Check if configuration exists already
    stat: path=/etc/re6stnet/re6stnet.conf
    register: re6stnet_conf

  - name: Configure Re6st with re6st-conf
    shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ computer_name }}  -d /etc/re6stnet"
    when: re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ computer_name }}" != "noname"

  - name: Check if configuration exists already
    stat: path=/etc/re6stnet/re6stnet.conf
    register: recheck_re6stnet_conf

  - name: Start re6stnet service
    service: name=re6stnet state=started enabled=yes
    when: recheck_re6stnet_conf.stat.exists == True