Well, first push
This commit is contained in:
3
roles/linux_config_init/tasks/hostname_set.yml
Normal file
3
roles/linux_config_init/tasks/hostname_set.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
- name: Set a hostname
|
||||
ansible.builtin.hostname:
|
||||
name: "{{ host }}"
|
||||
12
roles/linux_config_init/tasks/main.yml
Normal file
12
roles/linux_config_init/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# tasks file for linux_config_init
|
||||
- name: System settings in /etc
|
||||
ansible.builtin.include_tasks: "{{ item }}"
|
||||
loop:
|
||||
- static_dns.yml
|
||||
- sudoer_no_passwd.yml
|
||||
- hostname_set.yml
|
||||
|
||||
- name: Set Pernament IP
|
||||
ansible.builtin.include_tasks: set_perma_ip.yml
|
||||
when: host != 'ntb'
|
||||
23
roles/linux_config_init/tasks/set_perma_ip.yml
Normal file
23
roles/linux_config_init/tasks/set_perma_ip.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Fedora version fetch
|
||||
shell: |
|
||||
nmcli c | grep ethernet | awk -F '\\s\\s' '{print $1}'
|
||||
register: prefedora_ver
|
||||
|
||||
- name: Delete all old ethernet connections for desktop exept below configured
|
||||
community.general.nmcli:
|
||||
conn_name: '*'
|
||||
state: absent
|
||||
when: host == 'desktop'
|
||||
|
||||
- name: Add an Ethernet connection with static IP configuration for desktop
|
||||
community.general.nmcli:
|
||||
conn_name: deksktop-local
|
||||
ifname: enp7s0
|
||||
type: ethernet
|
||||
ip4: 192.168.5.99/24
|
||||
gw4: 192.168.5.1
|
||||
dns4: 8.8.8.8
|
||||
state: present
|
||||
autoconnect: true
|
||||
when: host == 'desktop'
|
||||
14
roles/linux_config_init/tasks/static_dns.yml
Normal file
14
roles/linux_config_init/tasks/static_dns.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: DNS
|
||||
become: true
|
||||
ansible.builtin.blockinfile:
|
||||
state: present
|
||||
insertafter: EOF
|
||||
path: /etc/hosts
|
||||
mode: '0644'
|
||||
create: true
|
||||
block: |
|
||||
10.0.0.4 pi-vpn
|
||||
10.0.0.2 desktop-vpn
|
||||
192.168.5.99 desktop-local
|
||||
38.242.153.122 vps
|
||||
8
roles/linux_config_init/tasks/sudoer_no_passwd.yml
Normal file
8
roles/linux_config_init/tasks/sudoer_no_passwd.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: No password for sudo
|
||||
become: true
|
||||
community.general.sudoers:
|
||||
nopassword: true
|
||||
commands: ALL
|
||||
user: "{{ user }}"
|
||||
name: No password for sudo
|
||||
Reference in New Issue
Block a user