Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 13, 2021. It is now read-only.
/avmPublic archive

Ansible Version Manager (AVM)

License

NotificationsYou must be signed in to change notification settings

ahelal/avm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Ansible Version Manager (AVM) is a tool to manage multi Ansible installation by creating a python virtual environment for each version.

Why

  • Running multiple version of Ansible on the same host.
  • Using the development version of ansible for testing and using stable version for production.
  • Make your CI run multiple versions for testing i.e. travis, concourse, jenkins, ... or test-kitchen or molecule.
  • Create a wrapper script to manage Ansible within your teams and make upgrading roll back easier for many users with different OS and shells.
  • If you need add python packages to and make it accessible to Ansible without effecting your global python installation. i.e. boto, dnspython, netaddr or others

Incompatibly as of 1.0.0 version

  • Change in variable names
  • Stopped using bash arraysi.e. ANSIBLE_VERSIONS[0] to be more Posix and use flat variablesi.e. ANSIBLE_VERSIONS_0

For more info checkSetup variables

How

You have two options using asetup script orcommand to install

Setup wrapper script

Create a wrapper script this would be useful for CI or if you want your team to have unified installation.

#!/bin/shset -e# What version of AVM setup to useexport AVM_VERSION="v1.0.0"## Install Ansible 1.9.6 using pip and label it 'v1.9'export ANSIBLE_VERSIONS_0="1.9.6"export INSTALL_TYPE_0="pip"export ANSIBLE_LABEL_0="v1.9"## Install Ansible 2.2.3.0 using pip and label it 'v2.2'export ANSIBLE_VERSIONS_1="2.2.3.0"export INSTALL_TYPE_1="pip"export ANSIBLE_LABEL_1="v2.2"## Install Ansible 2.3.1.0 using pip and label it 'v2.3'export ANSIBLE_VERSIONS_2="2.3.1.0"export INSTALL_TYPE_2="pip"export ANSIBLE_LABEL_2="v2.3"## Install Ansible from devel using git and label it 'devel'export ANSIBLE_VERSIONS_2="devel"export INSTALL_TYPE_2="git"export ANSIBLE_LABEL_2="devel"# Whats the default versionexport ANSIBLE_DEFAULT_VERSION="v1.9"## Create a temp dir to download avmavm_dir="$(mktemp -d2> /dev/null|| mktemp -d -t'mytmpdir')"git clone https://github.com/ahelal/avm.git"${avm_dir}"> /dev/null2>&1## Run the setup/bin/sh"${avm_dir}/setup.sh"exit 0

Setup Command

You would need first to install avm

git clone https://github.com/ahelal/avm.gitcd avm./setup.sh

then you can use the avm cli to install

# Install stable release (defaults to pip)avm install --version 2.2.0.0 --label production# Install development releaseavm install --version devel --label dev --type git# if you have some python lib to install in the virtual env you can also add python requirements.txt fileavm install --version 2.0.0.0 --label legacy --requirements /path/to/requirements.txt

avm command usage

Once install you can useavm the cli to switch between version. for more info runavm --help

Usage:    avm  info    avm  list    avm  path <version>    avm  use <version>    avm  activate <version>    avm  install (-v version) [-t type] [-l label] [-r requirements]Options:    info                        Show ansible version in use    list                        List installed versions    path <version>              Print binary path of specific version    use  <version>              Use a <version> of ansible    activate <version>          Activate virtualenv for <version>

Setup variables

If you are usingSetup wrapper script you can override any of the following variables in your script.

NamedefaultDescription
AVM_VERSIONmasteravm version to install. Supports releases, tags, branches. if set to "local" will usepwd as source of installation.
AVM_VERBOSESetup verbosity could be empty, v, vv or vvv
SETUP_USER$USERThe setup user that will have avm and use avm.
SETUP_USER_HOME$USER home dirThe home dir of setup user.
AVM_IGNORE_SUDOSimply ignore sudo errors.
DEFAULT_INSTALL_TYPEpipDefault installation type if not defined.
AVM_UPDATE_VENV0
ANSIBLE_BIN_PATH/usr/local/binPath to install the ansible and avm binary.
ANSIBLE_VERSIONS_X
ANSIBLE_LABEL_X
INSTALL_TYPE_X
UBUNTU_PKGS

Supported platforms

Currently tested under

  • OSX
  • Ubuntu 14.04, 16.04
  • Alpine 3.4 (early support)

support shells

  • bash
  • dash
  • zsh
  • busybox ash

Alpine docker

Experimental support for Alpine in docker

if your installing fornon root user you require

apk add sudoecho"auth       sufficient pam_rootok.so"> /etc/pam.d/su

if your creating an image that does not have python or gcc you can do a cleanup at the end

apk del build-dependencies

Debugging

Verbosity

Setup verbosity could be empty orv,vv orvvv

i.e.AVM_VERBOSE="vv" your_setup.sh

v : Show verbose messages, but mute stdout, stderrvv : Show verbose messages and stdout, stderrvvv : Show verbose messages, stdout, stderr and set -x

In depth debugging

By default avm uses theAVM_VERSION to download and checkout that branch. if you want to debug and change the script you can useAVM_VERSION=local to use a local version of avm.

License

License (MIT)

Contribution

Your contribution is welcome.

About

Ansible Version Manager (AVM)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp