Add publickey vApp property;Configure SSH;Housekeeping
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
73c266632c
commit
5af4d729ef
@ -5,6 +5,19 @@
|
|||||||
generate_ssh_key: yes
|
generate_ssh_key: yes
|
||||||
ssh_key_bits: 2048
|
ssh_key_bits: 2048
|
||||||
ssh_key_file: .ssh/id_rsa
|
ssh_key_file: .ssh/id_rsa
|
||||||
|
- name: Save root SSH publickey
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /root/.ssh/authorized_keys
|
||||||
|
line: "{{ ovfproperties['guestinfo.rootsshkey'] }}"
|
||||||
|
- name: Disable SSH password authentication
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regex: "{{ item.regex }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
state: "{{ item.state }}"
|
||||||
|
loop:
|
||||||
|
- { regex: '$#PasswordAuthentication', line: 'PasswordAuthentication no', state: ''}
|
||||||
|
- { regex: '', line: 'PasswordAuthentication yes', state: absent}
|
||||||
- name: Delete 'ubuntu' user
|
- name: Delete 'ubuntu' user
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: ubuntu
|
name: ubuntu
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
purge: yes
|
purge: yes
|
||||||
- name: Delete leftover files
|
- name: Delete leftover files
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /root/snapd
|
path: /root/snap
|
||||||
state: absent
|
state: absent
|
||||||
- name: Hold snapd package
|
- name: Hold snapd package
|
||||||
ansible.builtin.dpkg_selections:
|
ansible.builtin.dpkg_selections:
|
||||||
|
@ -37,6 +37,13 @@ PropertyCategories:
|
|||||||
DefaultValue: ''
|
DefaultValue: ''
|
||||||
Configurations: '*'
|
Configurations: '*'
|
||||||
UserConfigurable: true
|
UserConfigurable: true
|
||||||
|
- Key: guestinfo.rootsshkey
|
||||||
|
Type: string(1..)
|
||||||
|
Label: Local root SSH public key*
|
||||||
|
Description: This line should start with 'ssh-rsa AAAAB3N'
|
||||||
|
DefaultValue: ''
|
||||||
|
Configurations: '*'
|
||||||
|
UserConfigurable: true
|
||||||
- Key: guestinfo.ntpserver
|
- Key: guestinfo.ntpserver
|
||||||
Type: string(1..)
|
Type: string(1..)
|
||||||
Label: Time server*
|
Label: Time server*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user