ZFS, NFS, Zeus setting, perma IP fix, again
This commit is contained in:
40
roles/linux_config_init/tasks/create_user.yml
Normal file
40
roles/linux_config_init/tasks/create_user.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
- name: Adding group
|
||||
ansible.builtin.group:
|
||||
name: "{{ user }}"
|
||||
state: present
|
||||
gid: "{{ uid }}"
|
||||
|
||||
- name: Adding user
|
||||
ansible.builtin.user:
|
||||
name: "{{ user }}"
|
||||
group: "{{ user }}"
|
||||
uid: "{{ uid }}"
|
||||
shell: /bin/bash
|
||||
groups: sudo
|
||||
|
||||
- name: Dowload ssh key
|
||||
ansible.builtin.uri:
|
||||
url: "{{ user_ssh_key_url }}"
|
||||
method: GET
|
||||
return_content: true
|
||||
register: ssh_key
|
||||
|
||||
- name: Setting ssh key
|
||||
ansible.builtin.blockinfile:
|
||||
state: present
|
||||
owner: "{{ user }}"
|
||||
group: "{{ user }}"
|
||||
insertafter: EOF
|
||||
path: /home/{{ user }}/.ssh/authorized_keys
|
||||
mode: '0644'
|
||||
create: true
|
||||
block: |
|
||||
{{ ssh_key.content }}
|
||||
|
||||
- name: Set permissions to .ssh folder
|
||||
ansible.builtin.file:
|
||||
path: /home/{{ user }}/.ssh
|
||||
owner: "{{ user }}"
|
||||
group: "{{ user }}"
|
||||
mode: '0711'
|
||||
10
roles/linux_config_init/templates/etc_hosts
Normal file
10
roles/linux_config_init/templates/etc_hosts
Normal file
@@ -0,0 +1,10 @@
|
||||
127.0.0.1 localhost.localdomain localhost
|
||||
{{ ip }} {{ host }}
|
||||
# The following lines are desirable for IPv6 capable hosts
|
||||
|
||||
::1 ip6-localhost ip6-loopback
|
||||
fe00::0 ip6-localnet
|
||||
ff00::0 ip6-mcastprefix
|
||||
ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
||||
ff02::3 ip6-allhosts
|
||||
15
roles/linux_config_init/templates/etc_network_interface
Normal file
15
roles/linux_config_init/templates/etc_network_interface
Normal file
@@ -0,0 +1,15 @@
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
iface {{ in_face }} inet manual
|
||||
ethernet-wol g
|
||||
auto vmbr0
|
||||
iface vmbr0 inet static
|
||||
address {{ ip }}/24
|
||||
gateway 192.168.5.1
|
||||
bridge-ports {{ in_face }}
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
|
||||
|
||||
source /etc/network/interfaces.d/*
|
||||
Reference in New Issue
Block a user