mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Merging chrismeyers's openstack work branch changes to the core
openstack module. Adding python-netifaces dependency for setup packaging
This commit is contained in:
@@ -50,11 +50,11 @@ import shade
|
|||||||
|
|
||||||
class OpenStackInventory(object):
|
class OpenStackInventory(object):
|
||||||
|
|
||||||
def __init__(self, private=False, refresh=False):
|
def __init__(self, refresh=False):
|
||||||
|
config_files = [ os.environ.get('OPENSTACK_CONFIG_FILE', None)
|
||||||
|
or '/etc/ansible/openstack.yml' ]
|
||||||
self.openstack_config = os_client_config.config.OpenStackConfig(
|
self.openstack_config = os_client_config.config.OpenStackConfig(
|
||||||
os_client_config.config.CONFIG_FILES.append(
|
config_files)
|
||||||
'/etc/ansible/openstack.yml'),
|
|
||||||
private)
|
|
||||||
self.clouds = shade.openstack_clouds(self.openstack_config)
|
self.clouds = shade.openstack_clouds(self.openstack_config)
|
||||||
self.refresh = refresh
|
self.refresh = refresh
|
||||||
|
|
||||||
@@ -92,10 +92,8 @@ class OpenStackInventory(object):
|
|||||||
hostvars = collections.defaultdict(dict)
|
hostvars = collections.defaultdict(dict)
|
||||||
|
|
||||||
for cloud in self.clouds:
|
for cloud in self.clouds:
|
||||||
|
|
||||||
# Cycle on servers
|
# Cycle on servers
|
||||||
for server in cloud.list_servers():
|
for server in cloud.list_servers():
|
||||||
|
|
||||||
meta = cloud.get_server_meta(server)
|
meta = cloud.get_server_meta(server)
|
||||||
|
|
||||||
if 'interface_ip' not in meta['server_vars']:
|
if 'interface_ip' not in meta['server_vars']:
|
||||||
@@ -131,9 +129,6 @@ class OpenStackInventory(object):
|
|||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser(description='OpenStack Inventory Module')
|
parser = argparse.ArgumentParser(description='OpenStack Inventory Module')
|
||||||
parser.add_argument('--private',
|
|
||||||
action='store_true',
|
|
||||||
help='Use private address for ansible host')
|
|
||||||
parser.add_argument('--refresh', action='store_true',
|
parser.add_argument('--refresh', action='store_true',
|
||||||
help='Refresh cached information')
|
help='Refresh cached information')
|
||||||
group = parser.add_mutually_exclusive_group(required=True)
|
group = parser.add_mutually_exclusive_group(required=True)
|
||||||
@@ -146,7 +141,7 @@ def parse_args():
|
|||||||
def main():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
try:
|
try:
|
||||||
inventory = OpenStackInventory(args.private, args.refresh)
|
inventory = OpenStackInventory(args.refresh)
|
||||||
if args.list:
|
if args.list:
|
||||||
inventory.list_instances()
|
inventory.list_instances()
|
||||||
elif args.host:
|
elif args.host:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ RUN apt-get update
|
|||||||
RUN apt-get install -y software-properties-common python-software-properties
|
RUN apt-get install -y software-properties-common python-software-properties
|
||||||
RUN add-apt-repository -y ppa:chris-lea/redis-server; add-apt-repository -y ppa:chris-lea/zeromq; add-apt-repository -y ppa:chris-lea/node.js
|
RUN add-apt-repository -y ppa:chris-lea/redis-server; add-apt-repository -y ppa:chris-lea/zeromq; add-apt-repository -y ppa:chris-lea/node.js
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y tmux git mercurial subversion python-dev python-pip libyaml-dev python-yaml python-paramiko python-jinja2 make postgresql python-psycopg2 python-ldap nodejs redis-server python-gevent libzmq3 python-zmq && rm -rf /var/lib/apt/lists/*
|
RUN apt-get install -y tmux git mercurial subversion python-dev python-pip libyaml-dev python-yaml python-paramiko python-jinja2 make postgresql python-psycopg2 python-ldap nodejs redis-server python-gevent libzmq3 python-zmq python-netifaces && rm -rf /var/lib/apt/lists/*
|
||||||
RUN git clone http://d7f73f8614295715a4777bf15f46d0d486ad0e21:x-oauth-basic@github.com/ansible/ansible-commander.git tower
|
RUN git clone http://d7f73f8614295715a4777bf15f46d0d486ad0e21:x-oauth-basic@github.com/ansible/ansible-commander.git tower
|
||||||
RUN pip install Django==1.6.7 django-devserver django-debug-toolbar django-jenkins ipython ansible
|
RUN pip install Django==1.6.7 django-devserver django-debug-toolbar django-jenkins ipython ansible
|
||||||
RUN cd /tower ; make develop
|
RUN cd /tower ; make develop
|
||||||
|
|||||||
Reference in New Issue
Block a user