Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Always Be Learning.

Brent Engelbrecht Zooloo2014

💭
Always Be Learning.
  • Cape Town, South Africa
View GitHub Profile
@Zooloo2014
Zooloo2014 / gist:29c7552b31f5069669caae7b5d1d2f82
Created Feb 18, 2019
Ansible role for checking existence of SSH key on target
View gist:29c7552b31f5069669caae7b5d1d2f82
---
- set_fact: do_token="{{ lookup('env', 'DO_API_TOKEN')}}"
- set_fact: ssh_key_name="{{ lookup('env', 'SSH_KEY_NAME')}}"
- name: ensure ssh key exists and get the key id
digital_ocean:
state: present
command: ssh
name: my_ssh_key
View gist:4b70adc9a1c2396f1f4ef95920e8a077
---
# tasks file for common
- name: install Python 2.x
raw: which python || sudo apt-get update && sudo apt-get install -qq -y python-simplejson
register: python_check
changed_when: not python_check.stdout is search('/usr/bin/python')
- name: install pip
apt:
name: python-pip
View gist:63f5e9a0de22face4349b85fdc241c43
echo "Update packages: "
docker exec -it $containerName sh -c "yum -y update"

echo "Add epel repos"
docker exec -it $containerName sh -c "yum -y install epel-release"

echo "Install needed packages: "
docker exec -it $containerName sh -c "yum install -y git rpm-build redhat-rpm-config gcc-c++ make nodejs"
You can’t perform that action at this time.