Fixes (#37)
* 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:
parent
b162731c29
commit
9736ee4bce
11
setup.sh
11
setup.sh
@ -52,16 +52,17 @@ while getopts ":lb:h" arg; do
|
||||
esac
|
||||
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
|
||||
echo "Using default branch $BRANCH."
|
||||
branch="$BRANCH"
|
||||
fi
|
||||
|
||||
if [[ $1 != "-"* ]]; then
|
||||
echo "ERROR: '$1' is not a valid option, please check your parameters and try again."
|
||||
usage 1
|
||||
fi
|
||||
|
||||
## Main ##
|
||||
|
||||
os="$(cat /etc/os-release)"
|
||||
|
@ -14,6 +14,7 @@
|
||||
package:
|
||||
name:
|
||||
- doas
|
||||
register: doas_install
|
||||
ignore_errors: yes
|
||||
|
||||
- name: General | Software | DoAs | Configure [Linux]
|
||||
@ -25,7 +26,7 @@
|
||||
state: present
|
||||
create: yes
|
||||
backup: yes
|
||||
when: ansible_system in ("Linux")
|
||||
when: not doas_install.failed and ansible_system in ("Linux")
|
||||
|
||||
- name: General | Software | DoAs | Configure [BSD]
|
||||
blockinfile:
|
||||
@ -36,7 +37,7 @@
|
||||
state: present
|
||||
create: yes
|
||||
backup: yes
|
||||
when: ansible_system in ("FreeBSD")
|
||||
when: not doas_install.failed and ansible_system in ("FreeBSD")
|
||||
|
||||
- name: General | Software | DoAs | Configure [Other]
|
||||
blockinfile:
|
||||
@ -50,4 +51,4 @@
|
||||
loop:
|
||||
- "{{ doas_conf_file_linux }}"
|
||||
- "{{ doas_conf_file_bsd }}"
|
||||
when: ansible_system not in ("Linux", "FreeBSD")
|
||||
when: not doas_install.failed and ansible_system not in ("Linux", "FreeBSD")
|
||||
|
Loading…
x
Reference in New Issue
Block a user