Commit 53c2de19 authored by Joanne Hugé's avatar Joanne Hugé

re6stnet: add location option

parent 310d1b18
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
private: no private: no
default: "http://re6stnet.nexedi.com/" default: "http://re6stnet.nexedi.com/"
- name: "location"
prompt: "What is your location? (format is \"country code,continent code\", e.g. FR,EU)"
private: no
default: "automatically detected with IP geolocalization"
- name: "re6sttoken" - name: "re6sttoken"
prompt: "Please insert your re6stnet token:" prompt: "Please insert your re6stnet token:"
private: no private: no
......
...@@ -9,8 +9,18 @@ ...@@ -9,8 +9,18 @@
- include: sysctl.yml - include: sysctl.yml
- name: Update Facts
set_fact:
location_option: "--location {{ location }}"
when: "{{ location }}"
- name: Update Facts
set_fact:
location_option: ""
when: not "{{ location }}"
- name: Configure Re6st with re6st-conf - 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" when: re6st_annon == True and re6stnet_conf.stat.exists == False and "{{ computer_name }}" != "noname"
- name: Update Facts - name: Update Facts
...@@ -22,11 +32,11 @@ ...@@ -22,11 +32,11 @@
- name: Configure Re6st with re6st-conf - 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" when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ re6st_fingerprint }}" != "nofingerprint"
- name: Configure Re6st with re6st-conf - 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" 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) - 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