Ask for username and password when provision metal nodes

This commit is contained in:
Khue Doan 2021-03-01 00:55:41 +07:00
parent f2f7599a02
commit 5ef7086cac
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,11 @@
- name: Start PXE server on the controller - name: Start PXE server on the controller
hosts: controller hosts: controller
vars_prompt:
- name: username
prompt: Enter username for metal nodes
private: no
- name: password
prompt: Enter password for metal nodes
roles: roles:
- pxe-server - pxe-server

View File

@ -29,6 +29,8 @@ services --enabled="chronyd"
# System timezone # System timezone
timezone Asia/Ho_Chi_Minh --isUtc timezone Asia/Ho_Chi_Minh --isUtc
# Create user
user --groups=wheel --name={{ username }} --password={{ password }}
# Add SSH key # Add SSH key
sshkey --username=root "{{ ssh_public_key }}" sshkey --username=root "{{ ssh_public_key }}"