feat: add CIFS utilities installation and configuration tasks
Some checks failed
Nix Format Check / check-format (push) Failing after 39s
Some checks failed
Nix Format Check / check-format (push) Failing after 39s
This commit is contained in:
@@ -5,59 +5,10 @@
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Check if /mnt/services is a mount point
|
||||
ansible.builtin.shell: mountpoint -q /mnt/services || echo "not_mounted"
|
||||
register: mnt_services_check
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
become: true
|
||||
- name: Include cifs tasks
|
||||
ansible.builtin.include_tasks: cifs.yml
|
||||
when: ansible_hostname == "mennos-cloud-server"
|
||||
|
||||
- name: Check if services git repo already exists
|
||||
ansible.builtin.stat:
|
||||
path: "/mnt/services/.git"
|
||||
register: git_dir_check
|
||||
become: true
|
||||
when: mnt_services_check.rc == 0
|
||||
|
||||
- name: Check if /mnt/services directory exists
|
||||
ansible.builtin.stat:
|
||||
path: "/mnt/services"
|
||||
register: mnt_services_dir
|
||||
changed_when: false
|
||||
become: true
|
||||
|
||||
- name: Clean /mnt/services directory
|
||||
ansible.builtin.shell: find /mnt/services -mindepth 1 -maxdepth 1 -exec rm -rf {} \;
|
||||
become: true
|
||||
when: mnt_services_check.rc == 0 and not git_dir_check.stat.exists|default(false) and mnt_services_dir.stat.exists
|
||||
|
||||
- name: Clone /mnt/services repository (initial clone)
|
||||
ansible.builtin.git:
|
||||
repo: "https://git.mvl.sh/vleeuwenmenno/services.git"
|
||||
dest: "/mnt/services"
|
||||
version: "main"
|
||||
become: true
|
||||
register: git_result
|
||||
changed_when: git_result.changed
|
||||
when: mnt_services_check.rc == 0 and not git_dir_check.stat.exists|default(false)
|
||||
|
||||
- name: Update /mnt/services repository (if already exists)
|
||||
ansible.builtin.git:
|
||||
repo: "https://git.mvl.sh/vleeuwenmenno/services.git"
|
||||
dest: "/mnt/services"
|
||||
update: true
|
||||
version: "main"
|
||||
force: true
|
||||
become: true
|
||||
register: git_result
|
||||
changed_when: git_result.changed
|
||||
when: mnt_services_check.rc == 0 and git_dir_check.stat.exists|default(false)
|
||||
|
||||
- name: Ensure /mnt/services ownership to users
|
||||
ansible.builtin.file:
|
||||
path: "/mnt/services"
|
||||
group: "users"
|
||||
recurse: true
|
||||
state: directory
|
||||
become: true
|
||||
when: mnt_services_check.rc == 0
|
||||
- name: Include services-repo tasks
|
||||
ansible.builtin.include_tasks: services-repo.yml
|
||||
when: ansible_hostname == "mennos-cloud-server"
|
||||
|
Reference in New Issue
Block a user