- About
- Before you begin
- Quick start
- Supported Goals
- Supported Package managers
- Directory structure and files
- Run Package Installation with goals
- Run Package Installation with tags
- Examples
This is Ansible based package management automation by Ansible Playbook (Playbook) and Ansible Hosts (goal
) with pre-defined package list as variable for goal
.
Checkout this or your forked repository into your local machine.
π‘ Recommendation:
Highly recommned to fork this repository into your github account and make your own or team's package list for mac setup.
Simply executing the make
command from the project root will start package installation for brew
, brew-cask
, npm
, and pip
of list in the host_vars/default
directory by default. it will prompt account password to ensure brew
package installation.
make
BECOME password: ****** [type-your-pwd]
setup and package installation.
brew
: Hombrew package.brew install [package]
cask
: Homebrew Cask package.brew install --cask [package]
mas
: Mac App Store withmas
cli.mas install <app_id>
npm
: NPM package.npm install --global [package]
pip
: PIP package.pip3 install [package]
βββ goals.ini # enabled and available goals list
βββ host_vars
β βββ aws # packages variables for AWS
β βββ default # default package variable
β βββ gcloud.yaml # packages variables for gcloud
β βββ golang # packages variables for golang
β βββ java # packages variables for java
β βββ k8s # packages variables for Kubernetes
β βββ node # packages variables for NodeJS
β βββ team-devops # packages variables for team-devops.
β β # example for team specific package list
β βββ template # template of package variable files
β # you can make your own package with this
βββ main.yml # main Ansible playbook
(actually this is Ansible Host file)
goals.ini
file manages the category of package. it has enabled 1 goal default
by default. so that if you run make
with no argument, it will just run package setup/installtion for list in host_vars/default
directory.
you can execute multiple goals by adding other available goals.
## Ansible inventory file that is named as goals to be friendly for non-Ansible users
default
## Followings are available goals list. please uncommnent or add to enable installation of packages
# default
# aws
# gcloud
# golang
# java
# k8s
# node
# team-devops ## Example of team specific package management
each directory/file names under host_vars
are 1:1 mapping with goal name in the goal.ini
file.
you can make host_var
as directory if you have many package list to deal with. or you can make single file like goal-name.yaml
if you have small list of package.
βββ host_vars
βββ aws # example of directory format for aws
β βββ brew-package.yaml # only has brew package list file
βββ default # example of directory format for default
β βββ brew-package.yaml # brew package list
β βββ cask-packages.yaml # brew-cask package list
β βββ npm-packages.yml # npm package list
β βββ pip-packages.yml # pip package lit
βββ goal-name.yaml # example of single file for goal-name goal
There are 2 way you can run multiple goals
- pass argument
goals
with comma seperated string when you runmake
- enalbe
goal
name in thegoal.ini
file
just simply add goal
name in the goal.ini
file. this will be easy way if you are maintaining your own or teams package list.
please ensure host variable of directory or file must be in host_vars
directory and name should match with your goal.
add yours or pre-defined goal in goal.ini
file:
default
your-goal-name
k8s
and, just run make with no argument:
make
there are 2 argument for make
command
goals
: goal names to execute specific goals. comma separated string of goalstags
: tag names to execute specific package type tag. comma separated string of tags
To run multiple goals
:
make goals=java,golang,k8s,team-devops
π‘ using argument will ignore goals list in the
goal.ini
file
Use tags
argument when you want to run specific type of package installation.
value for tags
must be comma seperated string. e.g.: tags=npm
, tags=brew,cask,pip
Global Tags: same as Supported Package managers
brew
cask
mas
npm
pip
Goal specific Tags:
gcloud
goalcomponents
:gcloud components install [package]
-
Perform package installation for all goals in my
goal.ini
:# add available goals in the goal.ini. then, make
-
Perform package installation for
java
,node
andk8s
:make goals=java,node,k8s
-
Perform
npm
andpip
package installation:make tags=npm,pip
-
Perform
brew
package installation only forjava
andk8s
goal:make goals=java,k8s tags=brew
-
Perform
gcloud
components installation only:make goals=gcloud tags=components