Skip to content

Commit

Permalink
templatizing the bcfg2_host
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Koenig committed Mar 1, 2011
1 parent b0e3aca commit 8f6ce67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions fab/initialization.py
Expand Up @@ -7,9 +7,10 @@
import update
from pantheon import pantheon

def initialize(vps=None):
def initialize(vps=None, bcfg2_host='config.getpantheon.com'):
'''Initialize the Pantheon system.'''
server = pantheon.PantheonServer()
server.bcfg2_host = bcfg2_host

_initialize_fabric()
_initialize_certificate()
Expand Down Expand Up @@ -84,7 +85,11 @@ def _initialize_bcfg2(server):
elif server.distro == 'centos':
local('yum -y install bcfg2 gamin gamin-python python-genshi ' + \
'python-ssl python-lxml libxslt')
pantheon.copy_template('bcfg2.conf', '/etc/')
template = pantheon.get_template('bcfg2.conf')
bcfg2_conf = pantheon.build_template(template, {"bcfg2_host": server.bcfg2_host})
with open('/etc/bcfg2.conf', 'w') as f:
f.write(bcfg2_conf)

# We use our own key/certs.
local('rm -f /etc/bcfg2.key bcfg2.crt')
# Run bcfg2
Expand Down
2 changes: 1 addition & 1 deletion fab/templates/bcfg2.conf
Expand Up @@ -16,4 +16,4 @@ user = mercury
ca = /usr/share/ca-certificates/pantheon.crt

[components]
bcfg2 = https://config.getpantheon.com:6789
bcfg2 = https://${bcfg2_host}:6789

0 comments on commit 8f6ce67

Please sign in to comment.