Giter Site home page Giter Site logo

ops-ci-aws's Introduction

ops-ci-aws

Current version: v2.3.0

This repository holds the shared Ansible roles, modules and tasks for projects to be deployed into AWS. It creates an Ansible collection.

Content

Ansible modules

Ansible roles

Usage

Install

Before we reach the state with high generalization and parameterization, this Ansible collection is not published to Galaxy. Instead, we use the direct git approach.

To install the latest version from the default branch:

ansible-galaxy collection install --force git+https://github.com/ringier-data/ops-ci-aws.git

To install a specific tagged version:

ansible-galaxy collection install --force git+https://github.com/ringier-data/ops-ci-aws.git,v2.3.1

To install a specific git commit:

ansible-galaxy collection install --force git+https://github.com/ringier-data/ops-ci-aws.git,7b60ddc245bc416b72d8ea6ed7b799885110f5e5

A note for all the ansible-galaxy collection install examples above: ansible-galaxy itself does not handle the upgrade if the remote collection has a higher version than the locally installed one, according to this Github issue. To overcome this problem, either we use --force to always overwrite the local installation no matter whether the version is newer or older, or we use --upgrade to "force" the installation if (and only if) the remote version is newer than the local one.

Config

A typical Ansible playbook looks like:

---
  - name: 'create CodeBuild projects'  # meaningful name defines the repo
    hosts: 'localhost'    # always localhost, we do not use the remote agent setup of Ansible 
    connection: 'local'   # always local
    collections: 'ringier.aws_cicd'   # tell Ansible to use this collection
    gather_facts: false   # we only gather some needed facts 
    vars:
      aws_region: 'eu-central-1'    # where the deployment target is located
      project_id: 'rcplus'          # project code. In our terminology, "project" is a very big thing (normally multi-year-multi-million)
      project_version: 1.0.3        # semver of the repo. Normally managed by PyPI package `bumpsemver`. NOTE: do NOT put any version prefix here
      software_component: 'devops'  # a code to help identify the purpose of repo. e.g. `basis`, `iris`, `foobar` etc.  
    pre_tasks:
      - fail: msg='specify an environment (dev, stg, prod, ops)'
        when: env not in ['dev', 'stg', 'prod', 'ops']
      - include_vars: 'environment_vars/{{ env }}.yml'
    roles:
      - 'init_workspace'  # normally the very first role of a playbook
      - 'configure-ci'    # do the repo specific deployment logic here
      - 'del_workspace'   # normally the very last role of a playbook 

Troubleshooting

Ansible installs the collection by default to ~/.ansible/collections/, make local modification there for debugging or troubleshooting.

ops-ci-aws's People

Contributors

zhaow-de avatar aartaria avatar thecopy avatar davidecantoni avatar jalmari-sor avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.