From f7876f2d33355f4f7b601b684d87d7ae7bd42186 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 28 May 2023 23:08:38 +0200 Subject: [PATCH] Changed repository pull to warning if not successfull due to github.com down --- roles/pc_application-ssh/tasks/main.yml | 9 ++++++++- roles/pc_system-gnome/tasks/main.yml | 7 +++++++ roles/pc_system-swapfile/tasks/main.yml | 7 +++++++ roles/server_docker-akaunting/tasks/main.yml | 7 +++++++ roles/server_docker-bigbluebutton/tasks/main.yml | 7 +++++++ roles/server_docker-elk/tasks/main.yml | 7 +++++++ roles/server_docker-roulette-wheel/tasks/main.yml | 7 +++++++ roles/server_native-docker-volume-backup/tasks/main.yml | 7 +++++++ roles/server_native-homepage/tasks/main.yml | 7 +++++++ 9 files changed, 64 insertions(+), 1 deletion(-) diff --git a/roles/pc_application-ssh/tasks/main.yml b/roles/pc_application-ssh/tasks/main.yml index 20c4eb49..afd18b2c 100644 --- a/roles/pc_application-ssh/tasks/main.yml +++ b/roles/pc_application-ssh/tasks/main.yml @@ -3,4 +3,11 @@ repo: "{{ssh_configuration_repository}}" dest: "$HOME/.ssh" update: yes - become: false \ No newline at end of file + register: git_result + ignore_errors: true + become: false + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed \ No newline at end of file diff --git a/roles/pc_system-gnome/tasks/main.yml b/roles/pc_system-gnome/tasks/main.yml index 4c0ba26e..426e40a8 100644 --- a/roles/pc_system-gnome/tasks/main.yml +++ b/roles/pc_system-gnome/tasks/main.yml @@ -19,8 +19,15 @@ repo: "git@github.com:kevinveenbirkenbach/cli-gnome-extension-manager.git" dest: "$HOME/Repositories/github.com/kevinveenbirkenbach/cli-gnome-extension-manager" update: yes + register: git_result + ignore_errors: true become: false +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed + - name: Execute CLI GNOME Extension manager script ansible.builtin.shell: bash "/home/{{client_username}}/Repositories/github.com/kevinveenbirkenbach/cli-gnome-extension-manager/gnome-extension-manager.sh" "{{ item[0] }}" "{{ item[1] }}" "{{ item[2] }}" loop: "{{gnome_extensions}}" diff --git a/roles/pc_system-swapfile/tasks/main.yml b/roles/pc_system-swapfile/tasks/main.yml index ac3421fc..d27c364e 100644 --- a/roles/pc_system-swapfile/tasks/main.yml +++ b/roles/pc_system-swapfile/tasks/main.yml @@ -3,8 +3,15 @@ repo: "https://github.com/kevinveenbirkenbach/create-linux-swapfile.git" dest: "$HOME/Repositories/github.com/kevinveenbirkenbach/create-linux-swapfile" update: yes + register: git_result + ignore_errors: true become: false +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed + - name: Execute create swapfile script ansible.builtin.shell: bash "/home/{{client_username}}/Repositories/github.com/kevinveenbirkenbach/create-linux-swapfile/create-linux-swapfile.sh" "{{swapfile_size}}" become: true \ No newline at end of file diff --git a/roles/server_docker-akaunting/tasks/main.yml b/roles/server_docker-akaunting/tasks/main.yml index 98ff8793..8fe5ebe6 100644 --- a/roles/server_docker-akaunting/tasks/main.yml +++ b/roles/server_docker-akaunting/tasks/main.yml @@ -25,6 +25,13 @@ update: yes notify: setup akaunting become: true + register: git_result + ignore_errors: true + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed - name: set akaunting version ansible.builtin.shell: find . -type f -exec sed -i 's/akaunting:latest/akaunting:{{akaunting_version}}/' {} + && find . -type f -exec sed -i 's/version=latest/version={{akaunting_version}}/' {} + diff --git a/roles/server_docker-bigbluebutton/tasks/main.yml b/roles/server_docker-bigbluebutton/tasks/main.yml index b4de5b2c..41b395b6 100644 --- a/roles/server_docker-bigbluebutton/tasks/main.yml +++ b/roles/server_docker-bigbluebutton/tasks/main.yml @@ -14,6 +14,13 @@ recursive: yes version: main notify: setup bigbluebutton + register: git_result + ignore_errors: true + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed - name: deploy .env template: src=env.j2 dest={{docker_compose_bigbluebutton_path}}/.env diff --git a/roles/server_docker-elk/tasks/main.yml b/roles/server_docker-elk/tasks/main.yml index 5fc6cb9c..ff1ddaf6 100644 --- a/roles/server_docker-elk/tasks/main.yml +++ b/roles/server_docker-elk/tasks/main.yml @@ -30,6 +30,13 @@ dest: "{{docker_elk_compose_path}}" update: yes notify: recreate server_docker-elk + register: git_result + ignore_errors: true + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed - name: copy docker-compose.yml template: src=docker-compose.yml.j2 dest={{docker_elk_compose_path}}docker-compose.yml diff --git a/roles/server_docker-roulette-wheel/tasks/main.yml b/roles/server_docker-roulette-wheel/tasks/main.yml index eaa70d59..812d7c1e 100644 --- a/roles/server_docker-roulette-wheel/tasks/main.yml +++ b/roles/server_docker-roulette-wheel/tasks/main.yml @@ -19,6 +19,13 @@ update: yes notify: recreate and build roulette-wheel become: true + register: git_result + ignore_errors: true + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed - name: add docker-compose.yml template: src=docker-compose.yml.j2 dest={{docker_compose_path}}docker-compose.yml diff --git a/roles/server_native-docker-volume-backup/tasks/main.yml b/roles/server_native-docker-volume-backup/tasks/main.yml index ee123c32..b02191fb 100644 --- a/roles/server_native-docker-volume-backup/tasks/main.yml +++ b/roles/server_native-docker-volume-backup/tasks/main.yml @@ -7,6 +7,13 @@ repo: "https://github.com/kevinveenbirkenbach/docker-volume-backup.git" dest: "{{docker_volume_backup_folder}}" update: yes + register: git_result + ignore_errors: true + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed - name: configure docker-volume-backup.service template: diff --git a/roles/server_native-homepage/tasks/main.yml b/roles/server_native-homepage/tasks/main.yml index 9112a1fb..35987aaa 100644 --- a/roles/server_native-homepage/tasks/main.yml +++ b/roles/server_native-homepage/tasks/main.yml @@ -10,3 +10,10 @@ repo: "{{homepage_repository_address}}" dest: "/usr/share/nginx/homepage" update: yes + register: git_result + ignore_errors: true + +- name: Warn if repo is not reachable + debug: + msg: "Warning: Repository is not reachable." + when: git_result.failed