From c3276c9056c0aa5dd67ac8c2f7bddb10e5d74e5f Mon Sep 17 00:00:00 2001 From: naisanzaa Date: Sun, 17 Nov 2024 10:29:01 +0800 Subject: [PATCH] [transmission] add role --- playbooks/roles/transmission/defaults/main.yaml | 2 ++ playbooks/roles/transmission/meta/main.yaml | 4 ++++ playbooks/roles/transmission/tasks/Apple Silicon.yml | 1 + playbooks/roles/transmission/tasks/Darwin.yml | 10 ++++++++++ playbooks/roles/transmission/tasks/Debian.yml | 3 +++ playbooks/roles/transmission/tasks/MacOSX.yml | 3 +++ playbooks/roles/transmission/tasks/RedHat.yml | 3 +++ playbooks/roles/transmission/tasks/main.yaml | 4 ++++ playbooks/roles/transmission/vars/main.yaml | 9 +++++++++ playbooks/transmission.yml | 4 ++++ 10 files changed, 43 insertions(+) create mode 100644 playbooks/roles/transmission/defaults/main.yaml create mode 100644 playbooks/roles/transmission/meta/main.yaml create mode 100644 playbooks/roles/transmission/tasks/Apple Silicon.yml create mode 100644 playbooks/roles/transmission/tasks/Darwin.yml create mode 100644 playbooks/roles/transmission/tasks/Debian.yml create mode 100644 playbooks/roles/transmission/tasks/MacOSX.yml create mode 100644 playbooks/roles/transmission/tasks/RedHat.yml create mode 100644 playbooks/roles/transmission/tasks/main.yaml create mode 100644 playbooks/roles/transmission/vars/main.yaml create mode 100644 playbooks/transmission.yml diff --git a/playbooks/roles/transmission/defaults/main.yaml b/playbooks/roles/transmission/defaults/main.yaml new file mode 100644 index 00000000..dfc4607e --- /dev/null +++ b/playbooks/roles/transmission/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +BREW_INSTALL: true \ No newline at end of file diff --git a/playbooks/roles/transmission/meta/main.yaml b/playbooks/roles/transmission/meta/main.yaml new file mode 100644 index 00000000..697ed6a5 --- /dev/null +++ b/playbooks/roles/transmission/meta/main.yaml @@ -0,0 +1,4 @@ +--- +dependencies: + - defaults + - brew \ No newline at end of file diff --git a/playbooks/roles/transmission/tasks/Apple Silicon.yml b/playbooks/roles/transmission/tasks/Apple Silicon.yml new file mode 100644 index 00000000..73b314ff --- /dev/null +++ b/playbooks/roles/transmission/tasks/Apple Silicon.yml @@ -0,0 +1 @@ +--- \ No newline at end of file diff --git a/playbooks/roles/transmission/tasks/Darwin.yml b/playbooks/roles/transmission/tasks/Darwin.yml new file mode 100644 index 00000000..f9144323 --- /dev/null +++ b/playbooks/roles/transmission/tasks/Darwin.yml @@ -0,0 +1,10 @@ +--- +- name: Apple Silicon + include_tasks: "Apple Silicon.yml" + when: | + ansible_facts.processor == "Apple M1" or + ansible_facts.processor == "Apple M2" or + ansible_facts.processor == "Apple M3" + +- name: "{{ansible_facts.distribution}}" + include_tasks: "{{ansible_facts.distribution}}.yml" \ No newline at end of file diff --git a/playbooks/roles/transmission/tasks/Debian.yml b/playbooks/roles/transmission/tasks/Debian.yml new file mode 100644 index 00000000..934178d4 --- /dev/null +++ b/playbooks/roles/transmission/tasks/Debian.yml @@ -0,0 +1,3 @@ +--- +- apt: update_cache=yes name={{ package }} state=latest + become: yes \ No newline at end of file diff --git a/playbooks/roles/transmission/tasks/MacOSX.yml b/playbooks/roles/transmission/tasks/MacOSX.yml new file mode 100644 index 00000000..ad756dab --- /dev/null +++ b/playbooks/roles/transmission/tasks/MacOSX.yml @@ -0,0 +1,3 @@ +--- +- include_role: name=brew-installer +- include_role: name=mac-installer \ No newline at end of file diff --git a/playbooks/roles/transmission/tasks/RedHat.yml b/playbooks/roles/transmission/tasks/RedHat.yml new file mode 100644 index 00000000..9404bb7e --- /dev/null +++ b/playbooks/roles/transmission/tasks/RedHat.yml @@ -0,0 +1,3 @@ +--- +- yum: name={{ package }} state=latest + become: yes \ No newline at end of file diff --git a/playbooks/roles/transmission/tasks/main.yaml b/playbooks/roles/transmission/tasks/main.yaml new file mode 100644 index 00000000..3b98ef29 --- /dev/null +++ b/playbooks/roles/transmission/tasks/main.yaml @@ -0,0 +1,4 @@ +--- +- set_fact: package=transmission +- include_tasks: "{{ansible_facts.os_family}}.yml" + when: package \ No newline at end of file diff --git a/playbooks/roles/transmission/vars/main.yaml b/playbooks/roles/transmission/vars/main.yaml new file mode 100644 index 00000000..fbd56e59 --- /dev/null +++ b/playbooks/roles/transmission/vars/main.yaml @@ -0,0 +1,9 @@ +--- +url: +mac_dmg: +mac_pkg: +mac_zip: +mac_folder: +mac_app: + +BREW_INSTALL: true \ No newline at end of file diff --git a/playbooks/transmission.yml b/playbooks/transmission.yml new file mode 100644 index 00000000..93a7b312 --- /dev/null +++ b/playbooks/transmission.yml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - transmission \ No newline at end of file