Commit a52befcd authored by Rafael Monnerat's avatar Rafael Monnerat

playbook: Make re6st.yml generic a bit generic

  VIFIB Users may still using gnet-re6stnet.yml and/or vifib-re6stnet.yml
parent bd7d58b3
......@@ -2,27 +2,21 @@
hosts: 127.0.0.1
connection: local
vars_files:
- settings/vifib.yml
vars:
- re6sttoken: noname
- re6st_annon: False
- computer_name: noname
- re6st_fingerprint: nofingerprint
vars_prompt:
- name: "computer_name"
prompt: "Please insert your email or a name of this computer:"
private: no
default: "noname"
- name: "re6st_registry_url"
prompt: "What is the url to the Re6st registry?"
private: no
default: "http://re6stnet.nexedi.com/"
- name: "re6st_fingerprint"
prompt: "What is the Registry fingerprint?"
private: no
default: "sha256:61a8f3ef4bdf12aca0dad5c17e8fadd15966bdd68b1400c91ef8ee53f17c0d65"
- name: "re6sttoken"
prompt: "Please insert your re6stnet token:"
private: no
default: "notoken"
roles:
- { role: re6stnet, package_state: present }
......
......@@ -6,16 +6,24 @@
- include: sysctl.yml
- name: Configure Re6st with re6st-conf
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet"
when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ computer_name }}" != "noname"
shell: "re6st-conf --registry {{ re6st_registry_url }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet --anonymous"
when: re6st_annon == True and re6stnet_conf.stat.exists == False and "{{ computer_name }}" != "noname"
- name: Update Facts
set_fact:
computer_name: "{{ re6sttoken }}"
when: computer_name == "noname"
- debug: msg="{{ computer_name }}"
- name: Configure Re6st with re6st-conf
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ re6sttoken }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet"
when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ computer_name }}" == "noname"
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet"
when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ re6st_fingerprint }}" != "nofingerprint"
- name: Configure Re6st with re6st-conf
shell: "re6st-conf --registry {{ re6st_registry_url }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet --anonymous"
when: re6st_annon == True and re6stnet_conf.stat.exists == False and "{{ computer_name }}" != "noname"
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ re6sttoken }} -d /etc/re6stnet"
when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ re6st_fingerprint }}" == "nofingerprint"
- name: Check if configuration exists already
stat: path=/etc/re6stnet/re6stnet.conf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment