From a54e528f2508420bf7ee3a1d1a5892015354728a Mon Sep 17 00:00:00 2001 From: Raphael Werner Date: Tue, 25 Feb 2025 13:06:35 +0100 Subject: [PATCH 1/2] Initial commit and distro test --- .ansible/.lock | 0 .vscode/settings.json | 3 +++ install.sh | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 .ansible/.lock create mode 100644 .vscode/settings.json create mode 100644 install.sh diff --git a/.ansible/.lock b/.ansible/.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6a4f67a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "ansible.python.interpreterPath": "/opt/homebrew/bin/python3" +} \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..b9c7089 --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/usr/bin/ansible-playbook --inventory=localhost, +--- +- hosts: localhost + connection: local + force_handlers: true + vars: + ansible_python_interpreter: auto_silent + pre_tasks: + - name: Distribution + set_fact: + distribution: "{{ ansible_distribution }}" + # - set_fact: + # eff_uid_number: "{{ lookup('pipe', 'id -u') }}" + # - block: + # - debug: + # msg: "This program requires root privileges" + # - meta: end_play + # when: eff_uid_number|int != 0 + + tasks: + - ansible.builtin.debug: + msg: "{{distribution}}" \ No newline at end of file From daf29565a3cdb823dd0a2d4b3be34109744f3005 Mon Sep 17 00:00:00 2001 From: Raphael Werner Date: Tue, 25 Feb 2025 13:24:42 +0100 Subject: [PATCH 2/2] test --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b9c7089..d41c333 100644 --- a/install.sh +++ b/install.sh @@ -9,6 +9,7 @@ - name: Distribution set_fact: distribution: "{{ ansible_distribution }}" + hostname: "{{ ansible_hostname }}" # - set_fact: # eff_uid_number: "{{ lookup('pipe', 'id -u') }}" # - block: @@ -19,4 +20,4 @@ tasks: - ansible.builtin.debug: - msg: "{{distribution}}" \ No newline at end of file + msg: "{{distribution}}{{hostname}}" \ No newline at end of file