From 6d89265cc053b7b16c742036eac5833e0bec88b2 Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 5 Feb 2021 23:14:58 -0900 Subject: [PATCH 1/2] mv cloudcmd to roles --- group_vars/all.yml | 11 ----------- nas.yml | 9 +++++---- roles/cloudcmd/defaults/main.yml | 19 +++++++++++++++++++ .../cloudcmd/tasks/main.yml | 12 +++++++----- 4 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 roles/cloudcmd/defaults/main.yml rename tasks/cloudcmd.yml => roles/cloudcmd/tasks/main.yml (77%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..dedc8cd1 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -40,7 +40,6 @@ miniflux_enabled: false glances_enabled: false stats_enabled: false guacamole_enabled: false -cloudcmd_enabled: false virtual_desktop_enabled: false krusader_enabled: false @@ -388,16 +387,6 @@ miniflux_admin_username: admin miniflux_admin_password: supersecure miniflux_port: "8070" -### -### CloudCmd -### -cloudcmd_available_externally: "false" -cloudcmd_data_directory: "{{ docker_home }}/cloudcmd/config" -cloudcmd_browse_directory: "/" -cloudcmd_user_id: "0" -cloudcmd_group_id: "0" -cloudcmd_port: "7373" - ### ### Krusader ### diff --git a/nas.yml b/nas.yml index b3d30af3..99a22e7e 100644 --- a/nas.yml +++ b/nas.yml @@ -58,6 +58,11 @@ - bitwarden when: (bitwarden_enabled | default(False)) + - role: cloudcmd + tags: + - cloudcmd + when: (cloudcmd_enabled | default(False)) + - role: cloudflare_ddns tags: - cloudflare_ddns @@ -287,10 +292,6 @@ when: (jellyfin_enabled | default(False)) tags: jellyfin - - import_tasks: tasks/cloudcmd.yml - when: (cloudcmd_enabled | default(False)) - tags: cloudcmd - - import_tasks: tasks/krusader.yml when: (krusader_enabled | default(False)) tags: krusader diff --git a/roles/cloudcmd/defaults/main.yml b/roles/cloudcmd/defaults/main.yml new file mode 100644 index 00000000..2bf86018 --- /dev/null +++ b/roles/cloudcmd/defaults/main.yml @@ -0,0 +1,19 @@ +--- +# enable or disable the application +cloudcmd_enabled: false +cloudcmd_available_externally: "false" + +# directories +cloudcmd_data_directory: "{{ docker_home }}/cloudcmd/config" +cloudcmd_browse_directory: "/" + +# uid / gid +cloudcmd_user_id: "0" +cloudcmd_group_id: "0" + +# network +cloudcmd_hostname: "cloudcmd" +cloudcmd_port: "7373" + +# specs +cloudcmd_memory: "1g" diff --git a/tasks/cloudcmd.yml b/roles/cloudcmd/tasks/main.yml similarity index 77% rename from tasks/cloudcmd.yml rename to roles/cloudcmd/tasks/main.yml index f67936d0..5ce840ca 100644 --- a/tasks/cloudcmd.yml +++ b/roles/cloudcmd/tasks/main.yml @@ -1,12 +1,13 @@ --- -- name: Create CloudCmd Directories +- name: Create Cloudcmd Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ cloudcmd_data_directory }}" -- name: CloudCmd +- name: Create Cloudcmd Docker Container docker_container: name: cloudcmd image: coderaiser/cloudcmd @@ -14,6 +15,7 @@ volumes: - "{{ cloudcmd_data_directory }}:/config:rw" - "{{ cloudcmd_browse_directory }}:/mnt/fs" + network_mode: "bridge" ports: - "{{ cloudcmd_port }}:8000" env: @@ -21,11 +23,11 @@ PUID: "{{ cloudcmd_user_id }}" PGID: "{{ cloudcmd_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ cloudcmd_memory }}" labels: traefik.enable: "{{ cloudcmd_available_externally }}" - traefik.http.routers.cloudcmd.rule: "Host(`cloudcmd.{{ ansible_nas_domain }}`)" + traefik.http.routers.cloudcmd.rule: "Host(`{{ cloudcmd_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.cloudcmd.tls.certresolver: "letsencrypt" traefik.http.routers.cloudcmd.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.cloudcmd.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" - traefik.http.services.cloudcmd.loadbalancer.server.port: "8000" \ No newline at end of file + traefik.http.services.cloudcmd.loadbalancer.server.port: "8000" From 10e59ae053953b9eba0f29f38dea3d1db37ad947 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Feb 2021 22:47:18 +0000 Subject: [PATCH 2/2] Update main.yml --- roles/cloudcmd/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/cloudcmd/tasks/main.yml b/roles/cloudcmd/tasks/main.yml index 5ce840ca..eced6def 100644 --- a/roles/cloudcmd/tasks/main.yml +++ b/roles/cloudcmd/tasks/main.yml @@ -3,7 +3,6 @@ file: path: "{{ item }}" state: directory - # mode: 0755 with_items: - "{{ cloudcmd_data_directory }}" @@ -15,7 +14,6 @@ volumes: - "{{ cloudcmd_data_directory }}:/config:rw" - "{{ cloudcmd_browse_directory }}:/mnt/fs" - network_mode: "bridge" ports: - "{{ cloudcmd_port }}:8000" env: