From installing Ansible to building a Python environment in Vagrant's virtual environment

Record the flow from Mac to setting up Python environment using Ansible for Vagrant virtual machine.

Premise

environment

My ability

procedure

  1. Virtual machine preparation

  2. Move to the folder (AnsTest) where you want to put the virtual machine configuration file.

    1. vagrant init ubuntu/trusty64
  3. A file called `` `Vagrantfile``` will be created, so open it with your favorite editor.

  4. Uncomment `` `config.vm.network" private_network ", ip:" 192.168.33.10 "```.

  5. Create a Python virtual environment on the host

  6. ``` mkvirtualenv ans --no-site-packages --python = (Python path)` ``

  7. Specify Python 2.x series. It seems that Python 3.x series will be supported in the future.

  8. Install Ansible

    1. pip install ansible
  9. Creating and deploying inventory files

  10. Place it in `` `/ etc / ansiblewith the name hosts``` (optional).

  11. Write the following content. In [], enter the name to be specified as host in the playbook later, and the IP address in the line commented out in the Vagrantfile.

    [AnsTest]
    192.168.33.10
    
  12. Create a playbook

  1. Run Ansible
  2. ansible-playbook provision_vagrant.yml -k
  3. You will be prompted for a password with the -k option. Otherwise, you may get an authentication failure error. The default is `` `vagrant```.

About the contents of the playbook

There are many other good articles on basic writing and how to use modules, so I'll only write about where I'm addicted.

- name:Name of processing
  (Module name):(...)
  (Module execution details):(...)
- name:Name of processing
  (Module name):(...)
  (Module execution details):(...)

(...)

However, in some cases, `attribute = value` is written next to the module name, {{variable}} is told or not double quoted, and the grammar is still unknown.

Future goals

reference

Ansible Kotohajime

Introduction to Ansible

Recommended Posts

From installing Ansible to building a Python environment in Vagrant's virtual environment
Building a Python virtual environment
Building a Python virtual environment
Building a virtual environment with Python 3
Summary from building Python 3.4. * From source to building a scientific computing environment
How to develop in a virtual environment of Python [Memo]
[Mac] Building a virtual environment for Python
Add a Python virtual environment to VSCode
From building a Python environment for inexperienced people to Hello world
Everything from building a Python environment to running it on Windows
virtual environment in python
How to create a Python virtual environment (venv)
Ubuntu18.04.05 Creating a python virtual environment in LTS
Create a virtual environment with conda in Python
[Python] Web development preparation (building a virtual environment)
Think about building a Python 3 environment in a Mac environment
Work in a virtual environment with Python virtualenv.
From Python environment construction to virtual environment construction with anaconda
Migration from Python2 to Python3 (Python2 is rebuilt as a virtual environment and coexists)
Building a Python development environment on Windows -From installing Anaconda to linking Atom and Jupyter Notebook-
From setting up Raspberry Pi to installing Python environment
Steps from installing Python 3 to creating a Django app
Building and enabling a python virtual environment, etc. (venv)
How to build a new python virtual environment on Ubuntu
How to slice a block multiple array from a multiple array in Python
[Django3] Display a web page in Django3 + WSL + Python virtual environment
Building a development environment for Android apps-creating Android apps in Python
[Python] Building a virtual python environment for the pyramid tutorial (summary)
Building a kubernetes environment with ansible 2
Building a Python environment on Ubuntu
Create a virtual environment with Python!
Building a kubernetes environment with ansible 1
Post a message from IBM Cloud Functions to Slack in Python
How to get a string from a command line argument in python
[Pyenv] Building a python environment with ubuntu 16.04
Install Django in a pipenv virtual environment
How to access environment variables in Python
Method to build Python environment in Xcode 6
Building a virtual environment using homebrew + pyenv-virtualenv
Send a message from Python to Slack
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
I want to build a Python environment
Creating a python virtual environment on Windows
How to get a stacktrace in python
To reference environment variables in Python in Blender
Generate a class from a string in Python
Build a python virtual environment with pyenv
Convert from Markdown to HTML in Python
Creating a virtual environment in an Anaconda environment
I started Node.js in a virtual environment
Building a Python development environment for AI development
Steps to create a Python virtual environment with VS Code on Windows
How to get a value from a parameter store in lambda (using python)
How to install python package in local environment as a general user
Send a message from Slack to a Python server
Create a Vim + Python test environment in 1 minute
How to share a virtual environment [About requirements.txt]
Try to calculate a statistical problem in Python
How to open a web browser from python
How to clear tuples in a list (Python)