Commit e00c818f authored by Lu Xu's avatar Lu Xu 👀

playbook: conditional prompt for installing slapos node

parent 12902ec9
......@@ -2,9 +2,6 @@
hosts: 127.0.0.1
connection: local
vars:
- interface_name: lo
vars_prompt:
- name: "slapos_master_url"
prompt: "What is the url to the SlapOS Master API? (ignore if you already have a configured re6st and slapos):"
......@@ -17,14 +14,24 @@
default: "https://slapos.vifib.com/"
- name: "computer_name"
prompt: "What is this computer name? (ignore if you already have a configured re6st and slapos):"
prompt: "Name your computer (ignore if you already have a configured re6st and slapos or if you don't want to register your computer to SlapOS Master):"
private: no
default: "noname"
- name: "slapostoken"
prompt: "If you have slapos token if you have (ignore if you already have a configured slapos):"
private: no
default: "notoken"
pre_tasks:
- pause:
prompt: "Input your slapos token (ignore if you already have a configured slapos) [notoken]"
when: computer_name != "noname"
register: prompt
- set_fact:
slapostoken: "{{ prompt.user_input | default('notoken', true) }}"
- pause:
prompt: "Which network interface are you using? (ignore if you already have a configured re6st) [lo]"
when: slapostoken != "notoken"
register: prompt
- set_fact:
interface_name: "{{ prompt.user_input | default('lo', true) }}"
roles:
- { role: slapos, package_state: present }
......
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