Commit b31bcacd authored by Joanne Hugé's avatar Joanne Hugé

playbook/re6stnet: add option to manually specify location

parent 8f6dcb2d
Pipeline #23779 failed with stage
in 0 seconds
......@@ -13,6 +13,11 @@
private: no
default: "http://re6stnet.nexedi.com/"
- name: "location"
prompt: 'Manually enter your location (ignore if you want it detected automatically, format is "country code,continent code", e.g. "FR,EU")'
private: no
default: ""
- name: "re6sttoken"
prompt: "Please insert your re6stnet token:"
private: no
......
......@@ -9,8 +9,18 @@
- include: sysctl.yml
- name: Update Facts
set_fact:
location_option: "--location {{ location }}"
when: "{{ location | length | int }} > 0"
- name: Update Facts
set_fact:
location_option: ""
when: "{{ location | length | int }} == 0"
- name: Configure Re6st with re6st-conf
shell: "re6st-conf --registry {{ re6st_registry_url }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet --anonymous"
shell: "re6st-conf --registry {{ re6st_registry_url }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet --anonymous {{ location_option }}"
when: re6st_annon == True and re6stnet_conf.stat.exists == False and "{{ computer_name }}" != "noname"
- name: Update Facts
......@@ -22,11 +32,11 @@
- 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"
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ computer_name }} --fingerprint {{ re6st_fingerprint }} -d /etc/re6stnet {{ location_option }}"
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 }} --token {{ re6sttoken }} -r title {{ re6sttoken }} -d /etc/re6stnet"
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ re6sttoken }} -d /etc/re6stnet {{ location_option }}"
when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ re6st_fingerprint }}" == "nofingerprint"
- name: Recheck if configuration already exists (after running re6st-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