Installing Ansible from source (with fish shell)
-
Check python version
python --versionif python is not installed you should install it. -
Install easy_install and pip
sudo apt-get install python-setuptoolssudo easy_install pip -
Install c compiler
sudo apt-get install build-essentialand python devsudo apt-get install python-dev -
And install dependencies
sudo pip install paramiko PyYAML Jinja2 httplib2 six -
Move to directory where you want to install ansible (this should be directory that user has acces to because he will need to run set env script) ~/lib and execute
git clone git://github.com/ansible/ansible.git --recursive -
Go into directory
cd ./ansible -
Set running config script on login into shell (~/config/fish/config.fish)
# Run script to set ansible to work # > redirects stdout and ^ redirects stderr . /home/mladen/lib/ansible/hacking/env-setup.fish -q > /dev/null ^ /dev/null -
You should also add script to get latest version of ansible from git to /etc/init.d/
I named script refresh-ansible
#!/bin/sh # Help for setup: https://wiki.debian.org/LSBInitScripts ### BEGIN INIT INFO # Provides: refresh-ansible # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 3 # Default-Stop: # Short-Description: Start refresh-ansible at boot time # Description: Refreshes ansible instalation at boot time. ### END INIT INFO cd /home/mladen/lib/ansible git pull --rebase git submodule update --init --recursive -
You should make this file executable
sudo chmod +x refresh-ansibleand run commandsudo update-rc.d refresh-ansible defaults. This will add script to directory /etc/rc3.d/. If you later want to remove script from boot just runsudo update-rc.d refresh-ansible remove -
Next you need to install boto
sudo -H pip install -U boto -
Create ~/.boto file with content
[Credentials] aws_access_key_id = AKIAJTKAWVR5TELVR4VA aws_secret_access_key = wir9eklBfm8HQbDIlkxfIkOOpRb3VJ7mGFgVgu4a -
Change .boto permissions
chmod 400 ~/.boto -
Last you need to put your aws credentials in .ssh directory (*.pem)
No comments:
Post a Comment