This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set environment vars for a silent install through apt-get | |
export DEBIAN_FRONTEND=noninteractive | |
export DEBIAN_PRIORITY=critical | |
# Install the LDAP utilities | |
apt-get -y install libpam-ldap libnss-ldap nss-updatedb libnss-db | |
# Reset environment vars for apt-get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Contributors: | |
# henning mueller <[email protected]> | |
# Andrew Hamilton <[email protected]> | |
pkgname=euca2ools | |
pkgver=2.1.0 | |
pkgrel=1 | |
pkgdesc='Command-line tools for interacting with Amazon EC2 and S3 API-compatible Web services using the REST/Query API.' | |
arch=(any) | |
url=http://www.eucalyptus.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_euca_user() { | |
if [[ ! -z ${EC2_USER_ID} ]]; then | |
if [[ ! -e ${HOME}/.my_ec2_user_id || $(cat ${HOME}/.my_ec2_user_id | cut -d' ' -f1) -ne ${EC2_USER_ID} ]]; then | |
EC2_ACCOUNT_NAME=$(euare-accountlist | grep $EC2_USER_ID | cut -d' ' -f1) | |
echo ${EC2_USER_ID} ${EC2_ACCOUNT_NAME} >${HOME}/.my_ec2_user_id | |
else | |
EC2_ACCOUNT_NAME=$(cat $HOME/.my_ec2_user_id | cut -d' ' -f2) | |
fi | |
fi | |
echo ${EC2_ACCOUNT_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_euca_user() { | |
if [[ ! -z ${EC2_USER_ID} ]]; then | |
if [[ ! -e ${HOME}/.my_ec2_user_id || $(cat ${HOME}/.my_ec2_user_id | cut -d' ' -f1) -ne ${EC2_USER_ID} ]]; then | |
EC2_ACCOUNT_NAME=$(euare-accountlist | grep $EC2_USER_ID | cut -d' ' -f1) | |
EC2_USER_NAME=$(basename $EC2_CERT | cut -d'-' -f2) | |
echo ${EC2_USER_ID} ${EC2_ACCOUNT_NAME} >${HOME}/.my_ec2_user_id | |
else | |
EC2_ACCOUNT_NAME=$(cat $HOME/.my_ec2_user_id | cut -d' ' -f2) | |
EC2_USER_NAME=$(basename $EC2_CERT | cut -d'-' -f2) | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/foo", func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Basic Web Page") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Test | |
hosts: localhost | |
connection: local | |
vars: | |
my_file: '/Users/andrew/blah blah.txt' | |
tasks: | |
- name: Testing creation | |
command: /Users/andrew/blah.sh creates="{{ my_file }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: test | |
gather_facts: no | |
tasks: | |
- name: Pause for a test | |
local_action: pause seconds=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
connection: local | |
vars: | |
my_var: {"something": "{{ truth3 }}" } | |
tasks: | |
- debug: msg="Hello" | |
when: truth4 is not defined and my_var is defined | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
± % ansible-playbook -i deploy_conf/localhost test.yml | |
PLAY: *************************************************************************** | |
TASK [setup] ******************************************************************** | |
ok: [localhost] | |
TASK [debug msg=Hello] ********************************************************** | |
fatal: [localhost]: FAILED! => {"failed": true, "stdout": ""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ansible-playbook -i deploy_conf/localhost -vvv -e group=test test.yml | |
1 plays in test.yml | |
PLAY: *************************************************************************** | |
TASK [debug msg={{ my_var }}] *************************************************** | |
fatal: [localhost]: FAILED! => {"msg": "ERROR! the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'my_var' is undefined", "failed": true} | |
NO MORE HOSTS LEFT ************************************************************** |
OlderNewer