build
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
2025-11-21 00:39:51 +01:00
parent 19bdbfde78
commit 57b714271a
7 changed files with 42 additions and 4 deletions

View File

@@ -5,6 +5,9 @@
- name: setup
role: setup
tags: setup
- name: git
role: git
tags: git
- name: common
tags: common
role: common

View File

@@ -6,9 +6,9 @@ datacenter:
rpi5-1.home.lan:
rpi5.home.lan:
m-server.home.lan:
amd.home.lan:
fog.home.lan:
zabbix.home.lan:
amd.home.lan:
omv.home.lan:
192.168.77.101:
vars:
@@ -19,6 +19,7 @@ datacenter:
identity_file: ssh_key.pem
ansible_ssh_pass: l4c1j4yd33Du5lo
ansible_become_user: root
amd.home.lan:
nas:
hosts:
nas.home.lan:

View File

@@ -26,3 +26,8 @@
path: "/etc/hosts"
regexp: "^192.168.77.55 .*"
line: "192.168.77.55 rack rack.home.lan"
- name: Reconfigure hosts file
ansible.builtin.lineinfile:
path: "/etc/hosts"
regexp: "^193.168.144.164 .*"
line: "193.168.144.164 external"

View File

@@ -1,6 +1,11 @@
- name: Omv Setup
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
block:
# - name: Gather facts
# ansible.builtin.setup:
# - name: Print
# ansible.builtin.debug:
# msg: "{{ ansible_facts }}"
- name: Include vault
ansible.builtin.include_vars:
file: jaydee.yml
@@ -10,6 +15,21 @@
ansible.builtin.file:
state: absent
path: "{{ dest_folder }}"
- name: "Check if listed package is installed or not on Debian Linux family"
ansible.builtin.package:
name: "{{ item }}"
state: present
check_mode: true
loop:
- git
register: git_installed
- name: Include role only if missing
ansible.builtin.include_role:
name: git
when: not git_installed
- name: Pull repo
tags:
- git_pull

View File

@@ -17,7 +17,9 @@ Host nas
Host router
HostName router.home.lan
User root
Host external
HostName 193.168.144.164
User root
Host *
User jd
IdentityFile ~/.ssh/id_rsa

View File

@@ -1,6 +1,13 @@
- name: SSH keys deploy
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
block:
- name: Create dir
ansible.builtin.file:
path: /home/jd/.ssh
owner: jd
group: jd
mode: '0700'
state: directory
- name: Upload key
ansible.builtin.copy:
src: id_rsa
@@ -11,7 +18,7 @@
when: inventory_hostname != 'nas.home.lan'
- name: Upload key
ansible.builtin.copy:
src: id_rsa
src: id_rsa.pub
dest: /home/jd/.ssh/id_rsa.pub
mode: '0600'
owner: jd

View File

@@ -59,7 +59,7 @@
- ansible_facts.architecture != "armv7l"
- ansible_facts.architecture != "aarch64"
- ansible_distribution == "Debian"
- ansible_distribution_major_version == "12"
- ansible_distribution_major_version == "13"
register: command_result
failed_when: "'FAILED' in command_result.stderr"
# - name: Install a .deb package localy