Xicheng Chang 31a3c755f4 Update: add ansible code
Ansible for installing:
Chef(host)
Cobbler
Compass
Currently only three components being on the same host is supported.

Change-Id: I1f36ee77546d3e5734a69660dde9edc41dc8ea13
2015-01-28 10:46:52 -08:00

19 lines
436 B
Django/Jinja

#!/usr/bin/python
import logging
from cobbler import api
from subprocess import call
SERVER='{{ cobbler_server }}:{{ cobbler_mapped_http_port_on_host }}'
def main():
"""main entry"""
cobbler_api = api.BootAPI()
for system in cobbler_api.systems():
sys_name = system.name
call(["cobbler", "system", "edit", "--name=%s" % sys_name, "--server=%s" % SERVER])
return
if __name__ == '__main__':
main()