-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some dependencies and set uppercase variable in script.sh
- Loading branch information
1 parent
7904285
commit 284c424
Showing
4 changed files
with
44 additions
and
19 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
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
Very First Step | ||
======== | ||
|
||
Install Python using ansible module `raw` since any other ansible module, such as `apt`, needs python installed: | ||
`ansible-playbook -i hosts.yml -u root python.yml` | ||
|
||
``` | ||
ansible-playbook -i hosts.yml -u root python.yml | ||
``` |
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
#!/bin/bash | ||
declare -A osInfo; | ||
osInfo[/etc/debian_version]="apt" | ||
osInfo[/etc/alpine-release]="apk" | ||
osInfo[/etc/centos-release]="yum" | ||
osInfo[/etc/fedora-release]="dnf" | ||
|
||
for f in ${!osInfo[@]} | ||
declare -A OS_INFO; | ||
OS_INFO[/etc/debian_version]="apt" | ||
OS_INFO[/etc/alpine-release]="apk" | ||
OS_INFO[/etc/centos-release]="yum" | ||
OS_INFO[/etc/fedora-release]="dnf" | ||
|
||
for RELEASE_FILE in ${!OS_INFO[@]} | ||
do | ||
if [[ -f $f ]];then | ||
package_manager=${osInfo[$f]} | ||
if [[ -f $RELEASE_FILE ]];then | ||
PKG_MANAGER=${OS_INFO[$RELEASE_FILE]} | ||
fi | ||
done | ||
|
||
$package_manager install python3 | ||
$PKG_MANAGER update -y | ||
$PKG_MANAGER install -y python3 python3-pip |