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
#!/usr/bin/python | |
import ansible.runner | |
import sys | |
# construct the ansible runner and execute on all hosts | |
results = ansible.runner.Runner( | |
host_list=['10.20.30.40'], | |
pattern='*', | |
forks=10, |
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
# my virtualenvs are in ~/virtualenvs - you may need to adjust for your environment | |
cd ~/virtualenvs | |
virtualenv pelican-sprint-test | |
cd pelican-sprint-test | |
. bin/activate | |
mkdir ~/virtualenvs/pelican-sprint-test/src | |
cd ~/virtualenvs/pelican-sprint-test/src | |
git clone https://github.com/getpelican/pelican | |
cd pelican | |
pip install -r dev_requirements.txt |
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
[customerlon] | |
NOVA_URL=https://lon.identity.api.rackspacecloud.com/v2.0/ | |
NOVA_VERSION=1.1 | |
NOVA_RAX_AUTH=1 | |
NOVA_SERVICE_NAME=cloudServersOpenStack | |
NOVA_USERNAME=Username_here | |
NOVA_PASSWORD=API_key_here | |
NOVA_PROJECT_ID=DDI_number_here | |
NOVA_REGION_NAME=LON |
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
require 'activeresource' | |
API_PASSWORD = 'API_KEY_HERE' | |
class Zone < ActiveResource::Base | |
self.site = "https://#{API_PASSWORD}@api.slicehost.com/" | |
end | |
zone = Zone.new(:origin => 'myexample483727329784397.com', :ttl => 3000) | |
zone.save |
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
from pyactiveresource.activeresource import ActiveResource | |
api_password = 'API_KEY_HERE' | |
api_site = 'https://%s@api.slicehost.com/' % api_password | |
class Slice(ActiveResource): | |
_site = api_site | |
class Zone(ActiveResource): | |
_site = api_site |
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
from pyactiveresource.activeresource import ActiveResource | |
api_password = 'YOUR_API_KEY_GOES_HERE' | |
api_site = 'https://%s@api.slicehost.com/' % api_password | |
class Slice(ActiveResource): | |
_site = api_site | |
class Zone(ActiveResource): | |
_site = api_site |
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
""" | |
list cloud servers and their physical host | |
""" | |
import cloudservers | |
USERNAME = "your_username_here" | |
API_KEY = "your_api_key_here" | |
cloudservers = cloudservers.CloudServers(USERNAME, API_KEY) |
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
<VirtualHost *:80> | |
Servername yourdomain.com | |
ServerAlias www.yourdomain.com | |
Redirect permanent / http://www.facebook.com/yourUsernameOrWhatever | |
</VirtualHost> |
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
(rackspace)nick@mbp: ~/ansible-rackspace-servers$ ansible-playbook -i venv-inventory.yml build-cloud-server.yml | |
PLAY [Create a Rackspace Cloud Server] **************************************** | |
TASK: [Rackspace cloud server build request] ********************************** | |
ok: [localhost -> 127.0.0.1] | |
TASK: [Add new cloud server to host group] ************************************ | |
ok: [localhost -> 127.0.0.1] => (item={u'status': u'ACTIVE', u'rax_name': u'admin.enhancedtest.net', u'rax_metadata': {}, u'rax_progress': 100, u'rax_os-dcf_diskconfig': u'MANUAL', u'rax_human_id': u'adminenhancedtestnet', u'rax_addresses': {u'public': [{u'version': 6, u'addr': u'2001:4800:7818:104:be76:4eff:fe05:3c58'}, {u'version': 4, u'addr': u'104.130.158.89'}], u'private': [{u'version': 4, u'addr': u'10.209.36.188'}]}, u'rax_image': {u'id': u'0766e5df-d60a-4100-ae8c-07f27ec0148f', u'links': [{u'href': u'https://dfw.servers.api.rackspacecloud.com/HIDDEN/images/0766e5df-d60a-4100-ae8c-07f27ec0148f', u'rel': u'bookmark'}]}, u'rax_ |
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
PLAY [Create a Rackspace Cloud Server] **************************************** | |
TASK: [Rackspace cloud server build request] ********************************** | |
ok: [localhost -> 127.0.0.1] | |
TASK: [Add new cloud server to host group] ************************************ | |
ok: [localhost -> 127.0.0.1] => (item={u'status': u'ACTIVE', u'rax_name': u'admin.enhancedtest.net', u'rax_metadata': {}, u'rax_progress': 100, u'rax_os-dcf_diskconfig': u'MANUAL', u'rax_human_id': u'adminenhancedtestnet', u'rax_addresses': {u'public': [{u'version': 6, u'addr': u'2001:4800:7818:104:be76:4eff:fe05:3c58'}, {u'version': 4, u'addr': u'104.130.158.89'}], u'private': [{u'version': 4, u'addr': u'10.209.36.188'}]}, u'rax_image': {u'id': u'0766e5df-d60a-4100-ae8c-07f27ec0148f', u'links': [{u'href': u'https://dfw.servers.api.rackspacecloud.com/HIDDEN/images/0766e5df-d60a-4100-ae8c-07f27ec0148f', u'rel': u'bookmark'}]}, u'rax_user_id': u'HIDDEN', u'rax_links': [{u'href': u'https://dfw.servers.api.rackspacecloud.com/v2/HIDDEN/servers/0221 |
NewerOlder