Skip to content

Commit

Permalink
basic Readme basic Baseline, new var, github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoprudente committed Jul 9, 2020
1 parent e980bd9 commit 2d28b2f
Show file tree
Hide file tree
Showing 18 changed files with 256 additions and 97 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Ansible Lint # feel free to pick your own name

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v2

- name: Lint Ansible Playbook
# replace "master" with any valid ref
uses: ansible/ansible-lint-action@master
with:
# [required]
# Paths to ansible files (i.e., playbooks, tasks, handlers etc..)
# or valid Ansible directories according to the Ansible role
# directory structure.
# If you want to lint multiple ansible files, use the following syntax
# targets: |
# playbook_1.yml
# playbook_2.yml
targets: playbook.yml
# [optional]
# Arguments to override a package and its version to be set explicitly.
# Must follow the example syntax.
override-deps: |
ansible==2.9
ansible-lint==4.2.0
# [optional]
# Arguments to be passed to the ansible-lint

# Options:
# -q quieter, although not silent output
# -p parseable output in the format of pep8
# --parseable-severity parseable output including severity of rule
# -r RULESDIR specify one or more rules directories using one or
# more -r arguments. Any -r flags override the default
# rules in ansiblelint/rules, unless -R is also used.
# -R Use default rules in ansiblelint/rules in addition to
# any extra
# rules directories specified with -r. There is no need
# to specify this if no -r flags are used
# -t TAGS only check rules whose id/tags match these values
# -x SKIP_LIST only check rules whose id/tags do not match these
# values
# --nocolor disable colored output
# --exclude=EXCLUDE_PATHS
# path to directories or files to skip. This option is
# repeatable.
# -c C Specify configuration file to use. Defaults to ".ansible-lint"
args: ""
17 changes: 17 additions & 0 deletions .github/workflows/cfn-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint CloudFormation Templates

on: [push]

jobs:
cloudformation-linter:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: cfn-lint
uses: scottbrenner/cfn-lint-action@master
with:
args: "templates/**/*.yml"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CLOUDFORMATION_DIR = templates/cloudformation/

lint:
~/.local/bin/ansible-lint -x 204 -x 403 playbook.yml
$(foreach file, $(wildcard $(CLOUDFORMATION_DIR)/*), ~/.local/bin/cfn-lint $(file);)

format:
echo "test"
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
# All Might Box

Used to build a machine capacle of 1 click jump in in any

An extra customized Cloud9 Box for DevOps and general study!
This is the Ansible Roles that I use to configure my Developer, SysAdmin & DevOps box

## Why?

* From: Everywhere
* With: Vim / Vim Support
* And: Any Device

## Deploy

This will create an VPC with *n* public, *n* private subnets with Cloud9.
```bash
$sudo apt-get install python3 python3-pip
```

### Localhost

```bash
$git --depth=1 clone https://github.com/hugoprudente/all-might-box.git
```

**Install Ansible**

Using the [official documentation](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#) install Ansible.

**Run the playbook**

```bash
$git --depth=1 clone https://github.com/hugoprudente/cloud9-plusplus.git
$ansible-playbook --connection=local --inventory 127.0.0.1, playbook.yml --extra-vars "user=$USER"
```

**Configuration**

### Cloud

Configure the *REGION*, *NAME*, and *IAMUSER* on the **bin/deploy**, file to match your AWS configurations.

```
Expand All @@ -37,4 +52,11 @@ This creates [Public (IGW)/Private(NAT)](https://docs.aws.amazon.com/vpc/latest/

## Extra Setup

TODO, add ansible playbooks
TODO, add ansible playbooks
]

## Development

```
pip3 install ansible-lint
```
28 changes: 8 additions & 20 deletions group_vars/localhost.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
---
enable_packages:
- name: python

users: ubuntu

enable_packages:
- name: python3

# Versions
kubernetes_version: v1.18.0
# docker_version:
docker_composer_version: 1.25.5
# enable_kubernetes:
# kubernetes_version: v1.18.0

# locale: en_US.UTF-8
# timezone: Asia/Tokyo
# language: en_US:en
# linuxbrew_packages:
# - name: ncurses
# - name: readline
# - name: git
# - name: zsh
# - name: vim
# install_options: with-lua,with-luajit
# - name: z
# - name: rbenv
# - name: peco
# enable_docker:
# docker_compose
# docker_composer_version: 1.25.5
28 changes: 19 additions & 9 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,31 @@
- hosts: all
gather_facts: yes
vars:
bash_it:
enable: True
tmux:
enable: True
vim:
enable: True
htop:
enable: True
screen:
enable: True
zsh:
enable: False
kubernetes:
enable: true
enable: True
docker:
enable: true
enable: True



# aws:
# enable: false
# aws:
# enable: False
# hashicorp:
# enable: true
# enable: True
# cloud9:
# enable: true
# enable: True
# vscode:
# enable: true
# enable: True
# language_python:
# enable: tasdrue

Expand Down
25 changes: 8 additions & 17 deletions roles/baseline/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Hugo Prudente
description: Install baseline softwares for my all-might-box

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
Expand All @@ -14,7 +13,7 @@ galaxy_info:
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: Apache-2.0

min_ansible_version: 2.9

Expand All @@ -27,17 +26,10 @@ galaxy_info:
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: ubuntu
versions:
- 20.04

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
Expand All @@ -49,5 +41,4 @@ galaxy_info:

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

# if you add dependencies to this list.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 25 additions & 14 deletions roles/baseline/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
---
# tasks file for baseline
- import_tasks: amznlinux.yml
when: ansible_os_family|lower == 'redhat'

- import_tasks: users_directories.yml

# - import_tasks: bash_it.yml
# vars:
# user: ec2-user
# aliases:
# - general
# - ansible
# plugins:
# - history
# completions:
# - git

- name: baseline packages for Dawin
import_tasks: packages/darwin.yml
when: ansible_os_family != "Darwin"

- name: baseline packages for Debian
import_tasks: packages/debian.yml
when: ansible_os_family == "Debian"

- name: baseline packages for RedHat
import_tasks: packages/redhat.yml
when: ansible_os_family == "RedHat"

- import_tasks: shell/bash_it.yml
when: bash_it.enable
vars:
aliases:
- general
- ansible
plugins:
- history
completions:
- git
- import_tasks: shell/zsh.yaml
when: zsh.enable
# - import_tasks: shell/oh_my_zsh.yml
File renamed without changes.
41 changes: 41 additions & 0 deletions roles/baseline/tasks/packages/debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# tasks file for baseline
- name: install git
apt:
name: git
state: latest
become: yes
- name: install jq
apt:
name: jq
state: latest
become: yes
- name: install zsh
when: zsh.enable is defined
apt:
name: zsh
state: latest
become: yes
- name: install tmux
when: tmux.enable is defined
apt:
name: tmux
state: latest
become: yes
- name: install htop
when: htop.enable is defined
apt:
name: htop
state: latest
become: yes
- name: install screen
when: screen.enable
apt:
name: screen
state: latest
become: yes
- name: install vim
when: vim.enable
apt:
name: vim
state: latest
become: yes
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
# name: "@Development tools"
# state: latest
# become: yes

- name: install jq
yum:
name: jq
state: latest
become: yes
vars:
ansible_python_interpreter: /usr/local/bin/python3.8
- name: install zsh
when: zsh.enable is defined
yum:
name: zsh
state: latest
become: yes
vars:
ansible_python_interpreter: /usr/local/bin/python3.8
become: yes
Loading

0 comments on commit 2d28b2f

Please sign in to comment.