Skip to content

Instantly share code, notes, and snippets.

View fcharlier's full-sized avatar
🏠
Working from home

François Charlier fcharlier

🏠
Working from home
  • RedHat
  • Paris, France
View GitHub Profile
@fcharlier
fcharlier / autosign.conf
Created April 2, 2012 12:45
puppetmaster database setup
*
@fcharlier
fcharlier / site.pp
Created April 20, 2012 14:31
Activate IP forwarding
# Activate ip forwarding
exec { '/sbin/sysctl -w net.ipv4.ip_forward=1':
unless => "/sbin/sysctl net.ipv4.ip_forward | /bin/grep -q ' = 1$'",
}
exec { "persist ip forwarding":
command => "/bin/echo 'net.ipv4.ip_forward=1' > /etc/sysctl.conf",
unless => "/bin/grep -q '^net.ipv4.ip_forward=1$' /etc/sysctl.conf",
}
@fcharlier
fcharlier / gist:2429124
Created April 20, 2012 14:36
Load nbd module
exec { "insert_module_nbd":
command => "/bin/echo 'nbd' > /etc/modules",
unless => "/bin/grep 'nbd' /etc/modules",
}
exec { "/sbin/modprobe nbd":
unless => "/bin/grep -q '^nbd ' '/proc/modules'"
}
@fcharlier
fcharlier / tips.rst
Created June 6, 2012 15:20
Notes/Tips
  • Run a command each time the specified file is created (default behavior when saving a file in most editors):

    while inotifywait -e create <some/file.ext>; do <command>; done
    
  • Run a command each time a file is created (default behavior when saving a file in most editors) somewhere beneath the specified directory:

    while inotifywait -e create -r <some/directory>; do <command>; done
    
@fcharlier
fcharlier / keystone_user_roles.py
Created June 12, 2012 16:10
Two scripts to list all Keystone tenants/users/roles
#!/usr/bin/env python
import os
from keystoneclient.v2_0 import client
keystone = client.Client(token=os.environ['SERVICE_TOKEN'],
endpoint=os.environ['SERVICE_ENDPOINT'])
for tenant in keystone.tenants.list():
print '%s' % tenant.id
for user in tenant.list_users():
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/stdlib'
mod 'puppetlabs/apache'
mod 'puppetlabs/mysql'
mod 'puppetlabs/vcsrepo'
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/stdlib'
mod 'puppetlabs/apache'
mod 'puppetlabs/mysql'
mod 'puppetlabs/vcsrepo'
@fcharlier
fcharlier / bundle
Last active December 30, 2015 11:39
puppet-keystone spec tests fail when using puppet 3.0.x after upgrading to rspec-puppet 1.0.1
Using rake (10.1.0)
Using diff-lcs (1.2.5)
Using facter (1.6.18)
Using hiera (1.0.0)
Using metaclass (0.0.1)
Using mocha (0.14.0)
Using puppet (3.0.2)
Using puppet-lint (0.3.2)
Using rspec-core (2.14.7)
Using rspec-expectations (2.14.4)
Commit: 1f0bb50fc283accf0d1819d332d13473955072cc
=============================================
/detect.py
Info: detect_hpa : No controllers detected.
Traceback (most recent call last):
File "./detect.py", line 411, in <module>
_main()
File "./detect.py", line 403, in _main
detect_megacli(hrdw)
heat_template_version: 2013-05-23
description: >
Heat WordPress template to support Ubuntu, using only Heat OpenStack-native
resource types, and without the requirement for heat-cfntools in the image.
WordPress is web software you can use to create a beautiful website or blog.
This template installs a single-instance WordPress deployment using a local
MySQL database to store the data.
parameters: