時と場合によりけり

日々のアップデートとイノベーションに翻弄され彷徨える IT エンジニアの覚書

macOS Sierra に Anaconda を使って Ansible をインストールしてみる

概要

macOS Sierra に anyenv の pyenv でインストールした Anaconda を使って、Ansible を導入してみます。

最初は、Homebrew で Ansible をインストールしたのですが、依存パッケージの設定に手間がかかるのでやめました。Homebrew の Ansible を使うためには、Homebrew の OpenSSL パッケージが必要となるのですが、これが、rbenv のOpenSSL に干渉したりして、修正するための設定が面倒でした。修正にあたっては、以下の記事が参考になりました。

Homebrew brew linkしてもリンクしたopensslを使ってくれない。 - Qiita

というわけで、Anaconda を使ってインストールすることにしました。
pyenv や Anaconda については、以下のエントリーをご参照ください。

stangler.hatenablog.com

ハードウェア

  • マシン: Macbook Pro Early 2011
  • OS: macOS 10.12 Sierra
  • メモリ: 16 GB
  • ストレージ: SSD 512 GB

ソフトウェア

  • anyenv
  • pyenv 1.0.2-37-gaa36a3f
  • anaconda2-4.1.1
  • Python 2.7.12
  • ansible 2.1.2.0

Ansible とは

サーバー設定ツール。同じようなサーバー設定ツールである、Chef や Itamae が Ruby で動作するのに対し、Ansible は Python で動作します。Python 2.6 以降が必要ですが、Python 3 には対応していないようです。

Ansible is Simple IT Automation

Python 設定

作業ディレクトリ作成

Mac に任意のディレクトリを作成します。例として、ここでは、dev-basic という名前のディレクトリを作成します。

% mkdir dev-basic
% cd dev-basic

作業ディレクトリに anaconda2 を適用する

私の場合、システムワイドで anaconda3 を設定していて、普段使用する Python のバージョンは 3.5.2 にしています。Ansible は、Python 2.6 以降が必須なので、作業ディレクトリには、次のコマンドで anaconda2 を適用します。

% pyenv local anaconda2-4.1.1

設定されたかどうか、確認してみましょう。

% conda info -e
# conda environments:
#
root                  *  /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1

Python のバージョンも確認しておきます。

% python -V
Python 2.7.12 :: Anaconda 4.1.1 (x86_64)

リスト確認

現在使用している Anaconda に Ansible パッケージがインストールされているかどうか、一応、確認。

% conda list
% pip list

conda にも pip にも Ansible はインストールされていないようです。

検索

Ansible を検索してみます。

% conda search ansible

conda には Ansible は存在しません。

% pip search ansible
ansible-tower-cli (3.0.1)             - A CLI tool for Ansible Tower.
muon (0.3.0)                          - Docker wrapper for testing Ansible
                                        roles
bosh_inventory (0.2.1)                - Ansible dynamic inventory for bosh
                                        deployments
ansible-test (1.0.1)                  - UNKNOWN
fabric-tb (0.0.1)                     - Based on Fabric, use ansible-like
                                        config files.
pytest-ansible (1.3.1)                - Plugin for py.test to allow running
                                        ansible
arpm (0.0.3)                          - ansible package manager command line
                                        tool
mr.awsome.ansible (1.0b5)             - A plugin for mr.awsome providing
                                        integration with Ansible.
clc-ansible-module (1.1.16)           - Centurylink Cloud Ansible Modules
ec2ansible (0.1.2)                    - AWS EC2 inventory generator for
                                        Ansible
ansible_role_installer (0.2)          - Install Ansible roles from Git
                                        repositories
bossimage (0.3.0)                     - Tool to create AMIs with Ansible
ansible-vagrant (1.3.0)               - Simple helper to use ansible with
                                        vagrant
augploy (0.3.5)                       - AUGmentum dePLOYment automation tool,
                                        powered by ansible
ansiblator (0.6-13-28-10-2014)        - Ansiblator - makes Ansible api more
                                        Pythonic
ansible-testing (0.0.1)               - Python module and CLI to package and
                                        upload python lambda functions to AWS
                                        Lambda.
nexus_ansible (0.4)                   - A random test lib
ansible-tools (0.0.7)                 - Keyring integration and local
                                        execution wrappers for Ansible
ansible-windows-compat (0.1.1)        - Compatibility library to run Ansible
                                        Python modules on a Windows target.
ansible-bundle (0.3.9)                - Manage ansible role and modules
                                        versioned dependencies.
shade-ansible (1.0.0)                 - Nothing. This used to exist. It's now
                                        all in ansible
ansible-shell (0.0.5)                 - Interactive shell for ansible
ara (0.9.1)                           - ARA - Ansible run analysis
ansible-conductor (0.5.0)             - Dynamic inventory system for Ansible
ansible-marathon (0.2.0)              - An Ansible module for deploying
                                        applications to Mesos through Marathon
dockalot (0.4.0)                      - Build Docker images for the real world
                                        using ansible playbooks
ansible-inventory-grapher (2.3.1)     - Creates graphs representing ansible
                                        inventory
ansible_role_apply (0.0.0)            - Apply a single Ansible role to host(s)
                                        easily
ansible-plugin-clicap (0.6)           - Ansible plugin for collecting
                                        (capturing) command-line (cli) output
                                        from and interacting with network
                                        devices.
ansible-cmdb (1.6)                    - Generate host overview from ansible
                                        fact gathering output
ansible-vault (1.0.4)                 - R/W an ansible-vault yaml file
galaxy-updater (0.4.0)                - Retrieve the latest versions for all
                                        of your ansible-galaxy role
                                        dependencies.
molecule (1.12.4)                     - Molecule aids in the development, and
                                        testing of Ansible roles.
timmy (1.20.3)                        - Mirantis OpenStack Ansible-like tool
                                        for parallel node operations: two-way
                                        data transfer, log collection, remote
                                        command execution
packsible (0.2.2)                     - Combine the power of packer and
                                        ansible conveniently
winsible (0.1.0)                      - A Faster Ansible (especially on
                                        Cygwin)
ansiblereporter (1.9.5)               - Scripts for ansible to report host
                                        output data
dork (0.2.4)                          - Docker and ansible based development
                                        containers.
ansible-lint (3.3.3)                  - checks playbooks for practices and
                                        behaviour that could potentially be
                                        improved
ansible-roles-graph (0.1.0)           - Generate a graph of Ansible role
                                        dependencies.
ansible-docgen (0.0.3)                - Generate Documentation from Annotated
                                        Ansible Playbooks and Roles
ntc-ansible (0.1.0)                   - Dependencies for NTC Ansible modules
jenkins-job-builder-ansible (0.1.2)   - Ansible build step for Jenkins Job
                                        Builder
tripleo-validations (5.1.0)           - A collection of Ansible playbooks to
                                        detect and report potential issues
                                        during TripleO deployments
ansible-docgenerator (0.1.0)          - Simple tool for generating ansible
                                        role documentation
goodplay (0.7.0)                      - goodplay enables you to test your
                                        deployments and distributed software
                                        infrastructure by reusing your
                                        existing knowledge of Ansible.
ansible-role-manager (0.4)            - A tool for installing and managing
                                        Ansible roles, playbooks & modules.
sphinxcontrib_ansibleautodoc (0.0.3)  - autodoc for ansible playbook
osxstrap (0.0.32)                     - Better OSX provisioning using Ansible.
ecsutils (1.0.2.dev.24)               - Ansible Alicloud ecs utils
supervisorclusterctl (0.1.2)          - supervisorclusterctl is a cmd line
                                        tool that allows to control a cluster
                                        of processes by utilizing Supervisor
                                        and Ansible.
snfinv (0.1.2)                        - Dynamic ansible inventory for Synnefo
                                        IaaS nodes
foreman-ansible-inventory (0.0.4)     - Ansible dynamic inventory that queries
                                        the Foreman
ansible-roles (0.1.4)                 - Manage ansible roles.
ansible-toolkit (1.3.2)               - The missing Ansible tools
pocker-ansible (0.2.0)                - Collection of ansible plugins for
                                        docker orchestration using pocker
                                        library
ploy_ansible (1.3.2)                  - Plugin to integrate Ansible with ploy.
dauber (0.0.0.post1)                  - APACHE licensed project for running
                                        ansible playbooks
wayround_org_pyeditor (0.3.3)         - Simple extansible editor with projects
                                        and outline
ansible-troll (0.0.1)                 - Ansible role testing tool
droplets (1.0)                        - Library for building Ansible dynamic
                                        inventories for Digital Ocean.
subspace (0.2.5)                      - A pragmatic interface to
                                        programmatically use Ansible.
ansible-role (0.26)                   - The missing "ansible-role" command
tbcli (0.0.10)                        - Based on Fabric, use ansible-like
                                        config files.
ansigenome (0.5.6)                    - A tool to help you gather information
                                        and manage your Ansible roles.
ansidoc (0.5.5)                       - Manage ansible role documentation
ansible-ec2-inventory (0.1.8)         - Extendable Python module for ansible
                                        EC2 inventories
pyansible (1.0.3)                     - A module for interfacing with Ansible
                                        Runner and Inventory.
ansible-modules-hashivault (1.2.0)    - Ansible Modules for Hashicorp Vault
ansibleci (0.2.0)                     - Ansbile CI tests
tory_client (0.9.2)                   - client tools for the tory ansible
                                        inventory
ansible-container (0.2.0)             - Ansible Container empowers you to
                                        orchestrate, build, run, and ship
                                        Docker images built from Ansible
                                        playbooks.
nestedfacts (0.2.0)                   - This library enables users of Ansible
                                        to load nesteddirectories as local
                                        facts. Refer to the README formore
                                        details.
ansible-library (1.2.1)               - Minimal galaxy server to host private
                                        roles
loopabull (0.0.3)                     - Event loop driven Ansible playbook
                                        execution engine
LintPlaybook (0.1.dev1)               - Lint ansible-playbooks for logical
                                        pitfalls
ansible (2.1.2.0)                     - Radically simple IT automation
datemike (0.1.1)                      - Create Ansible tasks, plays, and
                                        playbooks in pure Python
ansible-art (0.3.2)                   - A simple tool to apply role of ansible
kapellmeister-ansible (0.1.0)         - Ansible Playbook manager.
ansible-flow (0.2.0)                  - Workflow tool to speed up interactions
                                        with Ansible
ansible-modules-idcf-dns (0.0.1)      - Ansible modules for IDCF-cloud DNS
ansible_importer (0.0.2)              - Small library to allow Ansible
                                        plugins/modules to be imported.
playbook_assistant (0.1)              - Simple utility for Ansible playbook
                                        creation and download
ansible-universe (1.11.23)            - Ansible role build tool
ovirt-ansible (0.3.2)                 - oVirt Ansible utility
cyclosible (0.3.4)                    - Cyclosible is a web-api to manage
                                        ansible
futen (0.0.1)                         - Conversion script to Ansible inventory
                                        file from OpenSSH configuration
mist.ansible (0.1.8)                  - Ansible modules for the mist.io
                                        service
suitable (0.7.3)                      - Suitable is a thin wrapper around the
                                        Ansible API.
ansible-review (0.10.1)               - reviews ansible playbooks, roles and
                                        inventory and suggests improvements
messier (0.1.1)                       - Test Ansible roles with Vagrant,
                                        similar to Test Kitchen
osa_differ (0.1.0)                    - Find changes between OpenStack-Ansible
                                        versions
ansible-mikrotik-utils (0.0.2)        - This module provides code that can
                                        parse exported configurations from
                                        Mikrotik devices, and create the
                                        script that represents the necessary
                                        commands to reach a target
                                        configuration.      This code is used
                                        by the `mkr_config` Ansible module, so
                                        that it can     idempotently manage
                                        the configuration of Mikrotik routers.
ansible-playbook-debugger (0.2.4)     - Debugger for Ansible Playbook
sibl (0.1.0)                          - Ansible skeleton generator.

ansible (2.1.2.0) というのが、ありました。結局、Ansible は pip にあって、conda にはないということです。

conda-build パッケージのインストール

pip install ansible で素直にインストールしてもよいのですが、せっかく Anaconda を使っているので、Ansible の管理を conda で行いたいと思います。以下のサイトが参考になりました。

https://gist.github.com/aphlysia/d5fcee79ff81b8272faf http://conda.pydata.org/docs/build_tutorials/pkgs.html

まずは、conda-build をインストールします。

% conda install conda-build
Fetching package metadata .......
Solving package specifications: ..........

Package plan for installation in environment /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-env-2.6.0            |                0          601 B
    anaconda-custom            |           py27_0           3 KB
    filelock-2.0.6             |           py27_0           8 KB
    pkginfo-1.3.2              |           py27_0          31 KB
    ruamel_yaml-0.11.14        |           py27_0         184 KB
    conda-4.2.9                |           py27_0         361 KB
    conda-build-2.0.4          |           py27_0         271 KB
    ------------------------------------------------------------
                                           Total:         857 KB

The following NEW packages will be INSTALLED:

    filelock:    2.0.6-py27_0
    pkginfo:     1.3.2-py27_0

The following packages will be UPDATED:

    anaconda:    4.1.1-np111py27_0 --> custom-py27_0
    conda:       4.1.6-py27_0      --> 4.2.9-py27_0
    conda-build: 1.21.3-py27_0     --> 2.0.4-py27_0
    conda-env:   2.5.1-py27_0      --> 2.6.0-0
    ruamel_yaml: 0.11.7-py27_0     --> 0.11.14-py27_0

Proceed ([y]/n)? y

Fetching packages ...
conda-env-2.6. 100% |################################| Time: 0:00:00 217.83 kB/s
anaconda-custo 100% |################################| Time: 0:00:00   1.19 MB/s
filelock-2.0.6 100% |################################| Time: 0:00:00  19.52 kB/s
pkginfo-1.3.2- 100% |################################| Time: 0:00:00 145.26 kB/s
ruamel_yaml-0. 100% |################################| Time: 0:00:02  82.25 kB/s
conda-4.2.9-py 100% |################################| Time: 0:00:01 294.49 kB/s
conda-build-2. 100% |################################| Time: 0:00:01 155.27 kB/s
Extracting packages ...
[      COMPLETE      ]|###################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|###################################################| 100%
Linking packages ...
[      COMPLETE      ]|###################################################| 100%

念のため conda 自体をアップグレード。

% conda upgrade conda
Fetching package metadata .......
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1:
#
conda                     4.2.9                    py27_0

インストールした conda-build パッケージも、念のためアップグレード。

% conda upgrade conda-build
Fetching package metadata .......
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1:
#
conda-build               2.0.4                    py27_0

pypi のパッケージから conda の Ansible 用レシピを作成する

% conda skeleton pypi ansible
Warning, the following versions were found for ansible
1.0
1.1
1.2
1.2.1
1.2.2
1.2.3
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.4
1.4.1
1.4.2
1.4.3
1.4.4
1.4.5
1.5
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.6
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
1.6.9
1.6.10
1.7
1.7.1
1.7.2
1.8
1.8.1
1.8.2
1.8.3
1.8.4
1.9.0
1.9.0.1
1.9.1
1.9.2
1.9.3
1.9.4
1.9.5
1.9.6
2.0.0
2.0.0.0
2.0.0.1
2.0.0.2
2.0.1.0
2.0.2.0
2.1.0.0
2.1.1.0
2.1.2.0
Using 2.1.2.0
Use --version to specify a different version.
Using url https://pypi.python.org/packages/5f/51/9f54f20180eb323a80451c9f48f508bd5bbe03008c136e125b4ce3946fcf/ansible-2.1.2.0.tar.gz (1.8 MB) for ansible.
Downloading ansible
Unpacking ansible...
done
working in /var/folders/h4/nlm7x1td5zxbq8xqgpd89hz80000gn/T/tmpnXuC9lconda_skeleton_ansible-2.1.2.0.tar.gz

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.2j             |                0         3.0 MB
    pyyaml-3.12                |           py27_0         153 KB
    setuptools-27.2.0          |           py27_0         522 KB
    ------------------------------------------------------------
                                           Total:         3.7 MB

The following NEW packages will be INSTALLED:

    openssl:    1.0.2j-0
    pip:        8.1.2-py27_0
    python:     2.7.12-1
    pyyaml:     3.12-py27_0
    readline:   6.2-2
    setuptools: 27.2.0-py27_0
    sqlite:     3.13.0-0
    tk:         8.5.18-0
    wheel:      0.29.0-py27_0
    yaml:       0.1.6-0
    zlib:       1.2.8-3

Applying patch: '/var/folders/h4/nlm7x1td5zxbq8xqgpd89hz80000gn/T/tmpnXuC9lconda_skeleton_ansible-2.1.2.0.tar.gz/pypi-distutils.patch'
patching file core.py
Hunk #1 succeeded at 169 with fuzz 2 (offset 2 lines).
Writing recipe for ansible

ビルド

% conda build ansible
BUILD START: ansible-2.1.2.0-py27_0
updating index in: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/osx-64
updating index in: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/noarch

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ipaddress-1.0.17           |           py27_0          29 KB
    cffi-1.8.3                 |           py27_0         190 KB
    cryptography-1.5.2         |           py27_0         401 KB
    paramiko-2.0.2             |           py27_0         215 KB
    ------------------------------------------------------------
                                           Total:         835 KB

The following NEW packages will be INSTALLED:

    cffi:         1.8.3-py27_0
    cryptography: 1.5.2-py27_0
    enum34:       1.1.6-py27_0
    idna:         2.1-py27_0
    ipaddress:    1.0.17-py27_0
    jinja2:       2.8-py27_1
    markupsafe:   0.23-py27_2
    openssl:      1.0.2j-0
    paramiko:     2.0.2-py27_0
    pip:          8.1.2-py27_0
    pyasn1:       0.1.9-py27_0
    pycparser:    2.14-py27_1
    pycrypto:     2.6.1-py27_4
    python:       2.7.12-1
    pyyaml:       3.12-py27_0
    readline:     6.2-2
    setuptools:   27.2.0-py27_0
    six:          1.10.0-py27_0
    sqlite:       3.13.0-0
    tk:           8.5.18-0
    wheel:        0.29.0-py27_0
    yaml:         0.1.6-0
    zlib:         1.2.8-3

Source cache directory is: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/src_cache
Found source in cache: ansible-2.1.2.0.tar.gz
Extracting download
Package: ansible-2.1.2.0-py27_0
source tree in: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/ansible_1476167601140/work/ansible-2.1.2.0


(中略)


Using /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/ansible_1476167601140/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python2.7/site-packages
Finished processing dependencies for ansible==2.1.2.0
compiling .pyc files...
number of files: 1919
Fixing permissions
Detected hard-coded path in text file bin/ansible
Detected hard-coded path in text file bin/ansible-console
Detected hard-coded path in text file bin/ansible-doc
Detected hard-coded path in text file bin/ansible-galaxy
Detected hard-coded path in text file bin/ansible-playbook
Detected hard-coded path in text file bin/ansible-pull
Detected hard-coded path in text file bin/ansible-vault
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible-console
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible-doc
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible-galaxy
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible-playbook
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible-pull
Detected hard-coded path in text file lib/python2.7/site-packages/ansible-2.1.2.0-py2.7.egg/EGG-INFO/scripts/ansible-vault
Fixing permissions
updating index in: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/osx-64
updating: ansible-2.1.2.0-py27_0.tar.bz2
TEST START: ansible-2.1.2.0-py27_0
updating index in: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/osx-64
updating index in: /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/noarch

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ansible-2.1.2.0            |           py27_0         3.0 MB  local

The following NEW packages will be INSTALLED:

    ansible:      2.1.2.0-py27_0 local
    cffi:         1.8.3-py27_0
    cryptography: 1.5.2-py27_0
    enum34:       1.1.6-py27_0
    idna:         2.1-py27_0
    ipaddress:    1.0.17-py27_0
    jinja2:       2.8-py27_1
    markupsafe:   0.23-py27_2
    openssl:      1.0.2j-0
    paramiko:     2.0.2-py27_0
    pip:          8.1.2-py27_0
    pyasn1:       0.1.9-py27_0
    pycparser:    2.14-py27_1
    pycrypto:     2.6.1-py27_4
    python:       2.7.12-1
    pyyaml:       3.12-py27_0
    readline:     6.2-2
    setuptools:   27.2.0-py27_0
    six:          1.10.0-py27_0
    sqlite:       3.13.0-0
    tk:           8.5.18-0
    wheel:        0.29.0-py27_0
    yaml:         0.1.6-0
    zlib:         1.2.8-3

+ source /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/bin/activate /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/ansible_1476167601140/_t_env
+ /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/ansible_1476167601140/_t_env/bin/python -s /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/ansible_1476167601140/test_tmp/run_test.py
===== testing package: ansible-2.1.2.0-py27_0 =====
import: u'ansible'
import: u'ansible.cli'
import: u'ansible.compat'
import: u'ansible.compat.six'
import: u'ansible.compat.tests'
import: u'ansible.config'
import: u'ansible.errors'
import: u'ansible.executor'
import: u'ansible.executor.process'
import: u'ansible.galaxy'
import: u'ansible.inventory'
import: u'ansible.inventory.vars_plugins'
import: u'ansible.module_utils'
import: u'ansible.modules'
import: u'ansible.modules.core'
import: u'ansible.modules.core.cloud'
import: u'ansible.modules.core.cloud.amazon'
import: u'ansible.modules.core.cloud.azure'
import: u'ansible.modules.core.cloud.digital_ocean'
import: u'ansible.modules.core.cloud.docker'
import: u'ansible.modules.core.cloud.google'
import: u'ansible.modules.core.cloud.linode'
import: u'ansible.modules.core.cloud.openstack'
import: u'ansible.modules.core.cloud.rackspace'
import: u'ansible.modules.core.cloud.vmware'
import: u'ansible.modules.core.commands'
import: u'ansible.modules.core.database'
import: u'ansible.modules.core.database.mysql'
import: u'ansible.modules.core.database.postgresql'
import: u'ansible.modules.core.files'
import: u'ansible.modules.core.inventory'
import: u'ansible.modules.core.network'
import: u'ansible.modules.core.network.basics'
import: u'ansible.modules.core.network.cumulus'
import: u'ansible.modules.core.network.eos'
import: u'ansible.modules.core.network.ios'
import: u'ansible.modules.core.network.iosxr'
import: u'ansible.modules.core.network.junos'
import: u'ansible.modules.core.network.nxos'
import: u'ansible.modules.core.network.openswitch'
import: u'ansible.modules.core.packaging'
import: u'ansible.modules.core.packaging.language'
import: u'ansible.modules.core.packaging.os'
import: u'ansible.modules.core.source_control'
import: u'ansible.modules.core.system'
import: u'ansible.modules.core.utilities'
import: u'ansible.modules.core.utilities.helper'
import: u'ansible.modules.core.utilities.logic'
import: u'ansible.modules.core.web_infrastructure'
import: u'ansible.modules.core.windows'
import: u'ansible.modules.extras'
import: u'ansible.modules.extras.cloud'
import: u'ansible.modules.extras.cloud.amazon'
import: u'ansible.modules.extras.cloud.azure'
import: u'ansible.modules.extras.cloud.centurylink'
import: u'ansible.modules.extras.cloud.cloudstack'
import: u'ansible.modules.extras.cloud.google'
import: u'ansible.modules.extras.cloud.lxc'
import: u'ansible.modules.extras.cloud.misc'
import: u'ansible.modules.extras.cloud.openstack'
import: u'ansible.modules.extras.cloud.profitbricks'
import: u'ansible.modules.extras.cloud.rackspace'
import: u'ansible.modules.extras.cloud.softlayer'
import: u'ansible.modules.extras.cloud.vmware'
import: u'ansible.modules.extras.cloud.webfaction'
import: u'ansible.modules.extras.clustering'
import: u'ansible.modules.extras.commands'
import: u'ansible.modules.extras.database'
import: u'ansible.modules.extras.database.influxdb'
import: u'ansible.modules.extras.database.misc'
import: u'ansible.modules.extras.database.mysql'
import: u'ansible.modules.extras.database.postgresql'
import: u'ansible.modules.extras.database.vertica'
import: u'ansible.modules.extras.files'
import: u'ansible.modules.extras.messaging'
import: u'ansible.modules.extras.monitoring'
import: u'ansible.modules.extras.network'
import: u'ansible.modules.extras.network.a10'
import: u'ansible.modules.extras.network.citrix'
import: u'ansible.modules.extras.network.f5'
import: u'ansible.modules.extras.notification'
import: u'ansible.modules.extras.packaging'
import: u'ansible.modules.extras.packaging.language'
import: u'ansible.modules.extras.packaging.os'
import: u'ansible.modules.extras.source_control'
import: u'ansible.modules.extras.system'
import: u'ansible.modules.extras.web_infrastructure'
import: u'ansible.modules.extras.windows'
import: u'ansible.new_inventory'
import: u'ansible.parsing'
import: u'ansible.parsing.utils'
import: u'ansible.parsing.vault'
import: u'ansible.parsing.yaml'
import: u'ansible.playbook'
import: u'ansible.playbook.role'
import: u'ansible.plugins'
import: u'ansible.plugins.action'
import: u'ansible.plugins.cache'
import: u'ansible.plugins.callback'
import: u'ansible.plugins.connection'
import: u'ansible.plugins.filter'
import: u'ansible.plugins.inventory'
import: u'ansible.plugins.lookup'
import: u'ansible.plugins.shell'
import: u'ansible.plugins.strategy'
import: u'ansible.plugins.test'
import: u'ansible.plugins.vars'
import: u'ansible.template'
import: u'ansible.utils'
import: u'ansible.utils.module_docs_fragments'
import: u'ansible.vars'
===== ansible-2.1.2.0-py27_0 OK =====
TEST END: ansible-2.1.2.0-py27_0
# If you want to upload this package to anaconda.org later, type:
#
# $ anaconda upload /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1/conda-bld/osx-64/ansible-2.1.2.0-py27_0.tar.bz2
#
# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes

Ansible インストール

ようやくインストールできます。自前で用意したことがわかるように local フラグを立てておきます。

% conda install --use-local ansible
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /Users/xxxxx/.anyenv/envs/pyenv/versions/anaconda2-4.1.1:

The following NEW packages will be INSTALLED:

    ansible:  2.1.2.0-py27_0 local
    paramiko: 2.0.2-py27_0

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ]|###################################################| 100%

確認

% conda list | grep ansible
ansible                   2.1.2.0                  py27_0    local

local フラグ付きで conda の配下に Ansible が入りました。

バージョン確認

一応、バージョンも確認しておきましょう。

% ansible --version
ansible 2.1.2.0
  config file =
  configured module search path = Default w/o overrides

以上です。