Skip to content

Instantly share code, notes, and snippets.

@mohclips
Created January 27, 2017 23:40
Show Gist options
  • Save mohclips/a5eb2b3282346dd3f76d836f0ea4fbc0 to your computer and use it in GitHub Desktop.
Save mohclips/a5eb2b3282346dd3f76d836f0ea4fbc0 to your computer and use it in GitHub Desktop.
ubuntu@nx-demo01-1b-jumpserver:~$ ansible-playbook --version
ansible-playbook 2.2.1.0
config file =
configured module search path = Default w/o overrides
TASK [create update admin password sql] ****************************************
fatal: [localhost]: FAILED! => {"changed": true, "failed": true, "msg": "Source /root/.ansible/tmp/ansible-tmp-1485555856.14-212188825967522/source not found"}
ubuntu@nx-demo01-1b-jumpserver:~$ ls -l /tmp/app/templates/
total 20
-rw-r--r-- 1 root root 344 Jan 27 23:30 guacamole_admin_change.sql.j2
-rw-r--r-- 1 root root 356 Jan 27 23:30 guacamole.properties.j2
-rw-r--r-- 1 root root 7966 Jan 27 23:30 server.xml.j2
-rw-r--r-- 1 root root 136 Jan 27 23:30 user-mapping.xml.j2
userdata: |
#!/bin/bash
echo "********************************** Upgrade OS"
apt update
apt -y dist-upgrade
echo "********************************** Install Ansible Deps"
apt-get -y install git python-pip python-dev python-crypto libffi-dev libssl-dev
echo "********************************** Install Ansible and deps"
pip2 install --upgrade ansible markupsafe 2>&1
echo "********************************** Git clone"
git clone https://github.com/mohclips/ansible-guacamole.git /tmp/app
echo "********************************** Run playbook"
cd /tmp/app/
export ANSIBLE_LOG_PATH=/tmp/app/ansible.out
#pushd /tmp/app
ansible-playbook --connection=local -i "localhost," ./install-guacamole.yml
#popd
exit 0
- name: "create update admin password sql"
template:
src: "{{ ansible_dir}}/templates/guacamole_admin_change.sql.j2"
dest: "{{ guacamole.source_code_path }}/guacamole_admin_change.sql"
owner: root
group: root
mode: 0600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment