* Don't create doas config if failed to install.

* Fix it better, previous change made it so that a value was required, could not just run setup.sh..
This commit is contained in:
Hyperling 2023-02-19 10:33:25 -06:00 committed by GitHub
parent b162731c29
commit 9736ee4bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -52,16 +52,17 @@ while getopts ":lb:h" arg; do
esac esac
done done
# Alert on historic usage of `setup.sh BRANCH`.
if [[ ! -z $1 && $1 != "-"* ]]; then
echo "ERROR: '$1' is not a valid option, please check your parameters and try again."
usage 1
fi
if [[ $branch == "" ]]; then if [[ $branch == "" ]]; then
echo "Using default branch $BRANCH." echo "Using default branch $BRANCH."
branch="$BRANCH" branch="$BRANCH"
fi fi
if [[ $1 != "-"* ]]; then
echo "ERROR: '$1' is not a valid option, please check your parameters and try again."
usage 1
fi
## Main ## ## Main ##
os="$(cat /etc/os-release)" os="$(cat /etc/os-release)"

View File

@ -14,6 +14,7 @@
package: package:
name: name:
- doas - doas
register: doas_install
ignore_errors: yes ignore_errors: yes
- name: General | Software | DoAs | Configure [Linux] - name: General | Software | DoAs | Configure [Linux]
@ -25,7 +26,7 @@
state: present state: present
create: yes create: yes
backup: yes backup: yes
when: ansible_system in ("Linux") when: not doas_install.failed and ansible_system in ("Linux")
- name: General | Software | DoAs | Configure [BSD] - name: General | Software | DoAs | Configure [BSD]
blockinfile: blockinfile:
@ -36,7 +37,7 @@
state: present state: present
create: yes create: yes
backup: yes backup: yes
when: ansible_system in ("FreeBSD") when: not doas_install.failed and ansible_system in ("FreeBSD")
- name: General | Software | DoAs | Configure [Other] - name: General | Software | DoAs | Configure [Other]
blockinfile: blockinfile:
@ -50,4 +51,4 @@
loop: loop:
- "{{ doas_conf_file_linux }}" - "{{ doas_conf_file_linux }}"
- "{{ doas_conf_file_bsd }}" - "{{ doas_conf_file_bsd }}"
when: ansible_system not in ("Linux", "FreeBSD") when: not doas_install.failed and ansible_system not in ("Linux", "FreeBSD")