Well, first push

This commit is contained in:
git
2023-04-19 17:02:43 +02:00
parent 825b252c9b
commit ee38cf8458
72 changed files with 1195 additions and 3 deletions

View 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/

View File

@@ -0,0 +1,2 @@
---
# defaults file for linux_config_tinker

View File

@@ -0,0 +1,2 @@
---
# handlers file for linux_config_tinker

View File

@@ -0,0 +1,3 @@
- name: Set a hostname
ansible.builtin.hostname:
name: "{{ host }}"

View 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'

View 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'

View 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

View 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

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- linux_config_tinker

View File

@@ -0,0 +1,2 @@
---
# vars file for linux_config_tinker