mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-16 14:02:52 +01:00
ssh config for manager. dont need to create soqemussh user on manager
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
Host *
|
||||
IdentityFile /home/soqemussh/.ssh/id_ed25519
|
||||
IdentityFile /etc/ssh/auth_keys/soqemussh/id_ed25519
|
||||
|
||||
@@ -5,44 +5,10 @@
|
||||
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
|
||||
# used for qemu+ssh connection between manager and hypervisors
|
||||
create_soqemussh_user:
|
||||
user.present:
|
||||
- name: soqemussh
|
||||
- shell: /bin/bash
|
||||
- home: /home/soqemussh
|
||||
{% if not GLOBALS.is_manager %}
|
||||
- groups:
|
||||
- wheel
|
||||
- qemu
|
||||
- libvirt
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if GLOBALS.is_manager %}
|
||||
|
||||
create_local_libvirt_ssh_key_dir:
|
||||
file.directory:
|
||||
- name: /opt/so/saltstack/local/salt/libvirt/ssh/keys
|
||||
- user: socore
|
||||
- group: socore
|
||||
- mode: 755
|
||||
- makedirs: True
|
||||
|
||||
# generate the key pair and put the pub key in salt local files roots
|
||||
generate_ssh_key_soqemussh:
|
||||
cmd.run:
|
||||
- name: ssh-keygen -q -N '' -t ed25519 -f /home/soqemussh/.ssh/id_ed25519
|
||||
- runas: soqemussh
|
||||
- unless: test -f /home/soqemussh/.ssh/id_ed25519
|
||||
- require:
|
||||
- user: create_soqemussh_user
|
||||
|
||||
soqemussh_ssh_key_to_local:
|
||||
cmd.run:
|
||||
- name: cp /home/soqemussh/.ssh/id_ed25519.pub /opt/so/saltstack/local/salt/libvirt/ssh/keys
|
||||
- onchanges:
|
||||
- cmd: generate_ssh_key_soqemussh
|
||||
|
||||
qemu_ssh_client_config:
|
||||
file.managed:
|
||||
- name: /root/.ssh/config
|
||||
@@ -50,6 +16,17 @@ qemu_ssh_client_config:
|
||||
|
||||
{% else %}
|
||||
|
||||
# used for qemu+ssh connection between manager and hypervisors
|
||||
create_soqemussh_user:
|
||||
user.present:
|
||||
- name: soqemussh
|
||||
- shell: /bin/bash
|
||||
- home: /home/soqemussh
|
||||
- groups:
|
||||
- wheel
|
||||
- qemu
|
||||
- libvirt
|
||||
|
||||
soqemussh_pub_key:
|
||||
ssh_auth.present:
|
||||
- user: soqemussh
|
||||
|
||||
Reference in New Issue
Block a user