Skip to content

Instantly share code, notes, and snippets.

View vccabral's full-sized avatar

Chris Cabral vccabral

  • Mythical.io
  • Washingon, D.C.
View GitHub Profile
os.environ["ANSIBLE_HOST_KEY_CHECKING"] = "False"
ansible.utils.VERBOSITY = 4
hosts = [self.address]
webInventory = ansible.inventory.Inventory(hosts)
from ansible import callbacks
from ansible import utils
stats = callbacks.AggregateStats()
playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY)
from django.views.generic.base import RedirectView
class CustomRedirectView(RedirectView):
def get_redirect_url(self, *args, **kwargs):
return redirect("other/"+kwargs['extra_url'])
urlpatterns = patterns('',
...
url(r'^base/(?P<extra_url>.*)/$', CustomRedirectView.as_view(), name='redirect_view_name'),
url(r'^other/', include("otherapp.urls"),
@vccabral
vccabral / gist:faa9477ffb776c743dac
Last active December 3, 2015 20:21
ansible_kingdom.log
(venv)Victors-MacBook-Air:aws_kingdom bracero$ ansible-playbook kingdom.yml
[WARNING]: provided hosts list is empty, only localhost is available
PLAY ***************************************************************************
TASK [setup] *******************************************************************
ok: [127.0.0.1]
TASK [Create basic System Admin] ***********************************************
@vccabral
vccabral / kingdom.yml
Last active December 3, 2015 20:21
Non-idempotent IAM users
# Basic user creation example
- hosts: 127.0.0.1
connection: local
tasks:
- name: Create basic System Admin
iam:
iam_type: user
name: "{{ item }}"
state: present
password: "password"
@vccabral
vccabral / puppetlinks
Created December 31, 2012 23:21
puppet links