{"revision": {"id": "f3e84da1-2f95-11f1-811a-e86a64d24d78", "node_id": "f3e74cbe-2f95-11f1-aa17-e86a64d24d78", "user_id": "edc3f576-2f95-11f1-900f-e86a64d24d78", "author": "foxhop", "data": "Ansible\r\n########\r\n\r\n\r\n\r\nhow to install on command and control server\r\n============================================\r\n\r\nFirst step install Ansible on your command and control server (laptop or workstation, lol).  \r\nThis section shows the  process I used on Fedora.\r\n\r\ninstall system dependancy\r\n\r\n.. code-block:: bash\r\n \r\n sudo yum -y install sshpass\r\n\r\nclone the git repo and create python virtualenv\r\n\r\n.. code-block:: bash\r\n\r\n git clone git://github.com/ansible/ansible.git\r\n cd ansible\r\n virtualenv .env\r\n\r\nsource the environment scripts and install the rest of the dependencies into the python virtualenv\r\n\r\n.. code-block:: bash\r\n\r\n source ./hacking/env-setup\r\n source ./.env/bin/activate \r\n pip install paramiko PyYAML jinja2 httplib2\r\n  \r\ncreate an ansible hosts file in /etc/ansible/hosts\r\n\r\n.. code-block:: bash\r\n\r\n sudo mkdir /etc/ansible\r\n sudo vim /etc/ansible/hosts\r\n\r\nput your targets into */etc/ansible/hosts* for example\r\n\r\n.. code-block:: bash\r\n\r\n 127.0.0.1\r\n\r\nand test!\r\n\r\n.. code-block:: bash\r\n\r\n ansible all -m ping --ask-pass\r\n\r\nAnsible assumes SSH keys, but may also use passwords, which is invoked with the `--ask-pass` flag.  Invoke the `--ask-sudo-pass` flag if you need to supply a sudo password.\r\n\r\n\r\nhow to prepare remote hosts\r\n=============================\r\n\r\nAnsible requires that remote hosts have an SSH service running, and that your public `SSH key` is setup.\r\nAnsible also requires that all remote hosts have Python 2.4.x and the python JSON library (python-simplejson).  Python 2.6.x and above ship with JSON library in the stdlib, so nothing needs to be done if you are using a newer operating system.\r\n\r\n\r\n\r\nquick notes\r\n============\r\n\r\nrun arbitary commands\r\n\r\n.. code-block:: bash\r\n\r\n ansible all --ask-pass -a \"uptime\"\r\n\r\nget all facts\r\n\r\n.. code-block:: bash\r\n\r\n ansible all --ask-pass -m setup\r\n\r\nchange the amount of parallel forks, (default is 5)\r\n\r\n.. code-block:: bash\r\n\r\n ansible all --ask-pass -f 20 -a \"uptime\" \r\n\r\n\r\n\r\n ", "source_format": "rst", "revision_number": 10, "created": 1400060191000}}