-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Installs ansible | ||
# | ||
# This file is sourced | ||
# | ||
. ./scripts/log | ||
. ./scripts/os | ||
|
||
ansible_check() { | ||
ANSIBLE=$(which ansible) | ||
if [ $? -ne 0 ] | ||
then | ||
log_warn "Please install ansible" | ||
else | ||
log_info "ansible available at $ANSIBLE" | ||
fi | ||
} | ||
|
||
ansible_install() { | ||
ANSIBLE=$(which ansible) | ||
if [ $? -ne 0 ] | ||
then | ||
case $OS_TYPE in | ||
"ubuntu"| "pop") | ||
log_info "Installing ansible on $OS_TYPE" | ||
sudo apt update | ||
sudo apt install software-properties-common | ||
sudo apt-add-repository --yes --update ppa:ansible/ansible | ||
sudo apt install ansible | ||
;; | ||
"fedora") | ||
log_info "Installing ansible on $OS_TYPE" | ||
sudo dnf install ansible | ||
;; | ||
*) | ||
log_error "Unknown OS $OS_TYPE" | ||
;; | ||
|
||
esac | ||
else | ||
log_info "ansible is already installed at $ANSIBLE" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# | ||
# Checks that all tools are available | ||
. ./scripts/tools/ansible | ||
|
||
ansible_check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
# | ||
# Installs necessary tools | ||
# | ||
. ./scripts/tools/ansible | ||
|
||
ansible_install |