Well, first push
This commit is contained in:
29
roles/linux_config_init/.travis.yml
Normal file
29
roles/linux_config_init/.travis.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
# Use the new container infrastructure
|
||||
sudo: false
|
||||
|
||||
# Install ansible
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python-pip
|
||||
|
||||
install:
|
||||
# Install ansible
|
||||
- pip install ansible
|
||||
|
||||
# Check ansible version
|
||||
- ansible --version
|
||||
|
||||
# Create ansible.cfg with correct roles_path
|
||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||
|
||||
script:
|
||||
# Basic role syntax check
|
||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
2
roles/linux_config_init/defaults/main.yml
Normal file
2
roles/linux_config_init/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for linux_config_tinker
|
||||
2
roles/linux_config_init/handlers/main.yml
Normal file
2
roles/linux_config_init/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for linux_config_tinker
|
||||
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
|
||||
2
roles/linux_config_init/tests/inventory
Normal file
2
roles/linux_config_init/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/linux_config_init/tests/test.yml
Normal file
5
roles/linux_config_init/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- linux_config_tinker
|
||||
2
roles/linux_config_init/vars/main.yml
Normal file
2
roles/linux_config_init/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for linux_config_tinker
|
||||
Reference in New Issue
Block a user