A simple demo of Ansible playbook operations
A simple introductory demo of Ansible playbook operations.
For a more in-depth discussion, check out this blog post.
$ cd $HOME/code
$ git clone https://github.com/rcrelia/ansible-mojo.git
$ cd ansible-mojo
$ sudo ln -s /etc/ansible $HOME/code/ansible-mojo
$ mkdir ~/vagrant-boxes/bento_ubuntu
$ cd ~/vagrant-boxes/bento_ubuntu
$ vagrant init bento/ubuntu-16.04; vagrant up --provider virtualbox
$ ssh-add ~/vagrant-boxes/bento_ubuntu/.vagrant/machines/default/virtualbox/private_key
$ ssh-keygen -t rsa -f ~/.ssh/ansible_key
$ cat ~/.ssh/ansible_key > $HOME/code/ansible-mojo/authorized_keys
$ ssh-add ~/.ssh/ansible_key
$ cd $HOME/src
$ git clone -b stable-2.2 git://github.com/ansible/ansible.git --recursive
$ cd ./ansible
$ source ./hacking/env-setup
$ ansible yourvmname -m setup -e ansible_ssh_user=vagrant
First run:
$ ansible-playbook main.yml -e ansible_ssh_user=vagrant
Subsequent runs:
$ ansible-playbook main.yml
Send edits/ideas to rcrelia.github@gmail.com, or fork the project on GitHub and
send me a pull request.
Author:: Rick Crelia
Copyright:: Copyright (c) 2016 Rick Crelia
License:: Apache License, Version 2.0
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.