Skip to content

Commit

Permalink
Merge pull request #336 from msimonin/stein-enoslib3
Browse files Browse the repository at this point in the history
Update to Stein
  • Loading branch information
msimonin authored May 6, 2019
2 parents 18c0269 + 92dd1f1 commit d1debb2
Show file tree
Hide file tree
Showing 46 changed files with 259 additions and 186 deletions.
7 changes: 0 additions & 7 deletions ansible.cfg

This file was deleted.

4 changes: 4 additions & 0 deletions docs/provider/grid5000.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Installation
Connect to a Grid'5000 frontend of your choice. Then, refer to the
:ref:`installation` section to install Enos.

To access the Grid'5000 API, you must configure
`python-grid5000 <https://pypi.org/project/python-grid5000/>`_. Please refer to
the corresponding documentation

If the `virtualenv` module is missing:

.. code-block:: bash
Expand Down
6 changes: 6 additions & 0 deletions docs/provider/vmong5k.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ machine sizes of the Vagrant provider to describe resources.

Refer to the :ref:`installation` section to install EnOS.


To access the Grid'5000 API, you must configure
`python-grid5000 <https://pypi.org/project/python-grid5000/>`_. Please refer to
the corresponding documentation


The following is a valid resource description:

.. literalinclude:: ../../tests/functionnal/tests/vmong5k/basic-00.yaml
Expand Down
8 changes: 7 additions & 1 deletion enos/ansible/roles/bootstrap_kolla/files/passwords.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ cloudkitty_database_password: demo
cloudkitty_keystone_password: demo
congress_database_password: demo
congress_keystone_password: demo
cyborg_database_password: demo
cyborg_keystone_password: demo
database_password: demo
designate_database_password: demo
designate_keystone_password: demo
designate_pool_id: 6c248d2d-99de-4294-a359-a47d00d13ed6
designate_pool_manager_database_password: demo
designate_rndc_key: 068eb558a86fae49f76d749e9429fae3
docker_registry_password: null
docker_registry_password: demo
etcd_cluster_token: demo
freezer_database_password: demo
freezer_keystone_password: demo
Expand Down Expand Up @@ -382,11 +384,14 @@ magnum_database_password: demo
magnum_keystone_password: demo
manila_database_password: demo
manila_keystone_password: demo
mariadb_backup_database_password: demo
memcache_secret_key: demo
metadata_secret: demo
mistral_database_password: demo
mistral_keystone_password: demo
monasca_agent_password: demo
monasca_database_password: demo
monasca_grafana_admin_password: demo
monasca_keystone_password: demo
murano_agent_rabbitmq_password: demo
murano_database_password: demo
Expand Down Expand Up @@ -514,6 +519,7 @@ outward_rabbitmq_cluster_cookie: demo
outward_rabbitmq_password: demo
panko_database_password: demo
panko_keystone_password: demo
placement_database_password: demo
placement_keystone_password: demo
prometheus_alertmanager_password: demo
prometheus_mysql_exporter_database_password: demo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions enos/ansible/roles/common/tasks/context/Chameleonkvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions enos/ansible/roles/common/tasks/context/G5k.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions enos/ansible/roles/common/tasks/context/Openstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions enos/ansible/roles/common/tasks/context/Static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
13 changes: 13 additions & 0 deletions enos/ansible/roles/common/tasks/context/Vagrant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Enable ipv6 (RabbitMQ/epmd won't start otherwise)
sysctl:
name: net.ipv6.conf.all.disable_ipv6
value: 0
state: present

- name: Make sure the ansible_hostname is resolvable (otherwise RabbitMQ/epmd won't start)
lineinfile:
path: /etc/hosts
insertbefore: BOF
line: "{{ hostvars[inventory_hostname]['ansible_' + network_interface].ipv4.address }} {{ansible_hostname}}"
regex: "^{{ hostvars[inventory_hostname]['ansible_' + network_interface].ipv4.address }} {{ansible_hostname}}.*"
3 changes: 3 additions & 0 deletions enos/ansible/roles/common/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
systemd: state=stopped name=nscd
ignore_errors: yes


- name: Include context specific tasks
include: "context/{{ context }}.yml"
83 changes: 76 additions & 7 deletions enos/inventories/inventory.sample
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ monitoring

[etcd:children]
control
compute

[influxdb:children]
monitoring
Expand Down Expand Up @@ -139,9 +138,19 @@ control
[qdrouterd:children]
control

[monasca-agent:children]
compute
control
monitoring
network
storage

[monasca:children]
monitoring

[storm:children]
monitoring

[mongodb:children]
control

Expand Down Expand Up @@ -219,6 +228,10 @@ control
[aodh:children]
control

[cyborg:children]
control
compute

[congress:children]
control

Expand Down Expand Up @@ -294,9 +307,6 @@ control
[glance-api:children]
glance

[glance-registry:children]
glance

# Nova
[nova-api:children]
nova
Expand Down Expand Up @@ -344,6 +354,9 @@ neutron
[neutron-infoblox-ipam-agent:children]
neutron

[neutron-metering-agent:children]
neutron

[ironic-neutron-agent:children]
neutron

Expand Down Expand Up @@ -466,9 +479,21 @@ murano
murano

# Monasca
[monasca-agent-collector:children]
monasca-agent

[monasca-agent-forwarder:children]
monasca-agent

[monasca-agent-statsd:children]
monasca-agent

[monasca-api:children]
monasca

[monasca-grafana:children]
monasca

[monasca-log-api:children]
monasca

Expand All @@ -478,6 +503,25 @@ monasca
[monasca-log-persister:children]
monasca

[monasca-log-metrics:children]
monasca

[monasca-thresh:children]
monasca

[monasca-notification:children]
monasca

[monasca-persister:children]
monasca

# Storm
[storm-worker:children]
storm

[storm-nimbus:children]
storm

# Ironic
[ironic-api:children]
ironic
Expand Down Expand Up @@ -521,6 +565,12 @@ solum
[solum-conductor:children]
solum

[solum-application-deployment:children]
solum

[solum-image-builder:children]
solum

# Mistral
[mistral-api:children]
mistral
Expand All @@ -531,6 +581,9 @@ mistral
[mistral-engine:children]
mistral

[mistral-event-engine:children]
mistral

# Ceilometer
[ceilometer-central:children]
ceilometer
Expand All @@ -541,6 +594,9 @@ ceilometer
[ceilometer-compute:children]
compute

[ceilometer-ipmi:children]
compute

# Aodh
[aodh-api:children]
aodh
Expand All @@ -554,6 +610,16 @@ aodh
[aodh-notifier:children]
aodh

# Cyborg
[cyborg-api:children]
cyborg

[cyborg-agent:children]
compute

[cyborg-conductor:children]
cyborg

# Congress
[congress-api:children]
congress
Expand Down Expand Up @@ -691,9 +757,6 @@ vitrage
[vitrage-graph:children]
vitrage

[vitrage-collector:children]
vitrage

[vitrage-ml:children]
vitrage

Expand Down Expand Up @@ -730,3 +793,9 @@ storage

[prometheus-alertmanager:children]
monitoring

[prometheus-openstack-exporter:children]
monitoring

[prometheus-elasticsearch-exporter:children]
elasticsearch
3 changes: 3 additions & 0 deletions enos/provider/chameleonbaremetal.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ def default_config(self):
default_config.update(DEFAULT_CONFIG)

return default_config

def __str__(self):
return "Chameleonbaremetal"
3 changes: 3 additions & 0 deletions enos/provider/chameleonkvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ def default_config(self):
default_config = super(Chameleonkvm, self).default_config()
default_config.update(DEFAULT_CONFIG)
return default_config

def __str__(self):
return "Chameleonkvm"
3 changes: 3 additions & 0 deletions enos/provider/enos_vagrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ def destroy(self, env):

def default_config(self):
return DEFAULT_CONFIG

def __str__(self):
return 'Vagrant'
19 changes: 10 additions & 9 deletions enos/provider/g5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

from enoslib.api import expand_groups
from enoslib.infra.enos_g5k import (api, provider)
from enoslib.infra.enos_g5k import (provider, g5k_api_utils, remote)
from enoslib.infra.enos_g5k.configuration import Configuration

from enos.provider.provider import Provider
Expand Down Expand Up @@ -42,12 +42,12 @@


def _count_common_interfaces(clusters):
interfaces = api.get_clusters_interfaces(clusters)
interfaces = g5k_api_utils.get_clusters_interfaces(clusters)
return min([len(x) for x in interfaces.values()])


def _get_sites(clusters):
clusters_sites = api.get_clusters_sites(clusters)
clusters_sites = g5k_api_utils.get_clusters_sites(clusters)
return set(clusters_sites.values())


Expand Down Expand Up @@ -129,29 +129,29 @@ def _provision(roles):
nodes = set([node.address for node in nodes])

# Provision nodes so we can run Ansible on it
api.exec_command_on_nodes(
remote.exec_command_on_nodes(
nodes,
'apt-get update && apt-get -y --force-yes install python',
'Installing python...')

# Bind volumes of docker in /tmp (free storage location on G5k)
api.exec_command_on_nodes(
remote.exec_command_on_nodes(
nodes,
('mkdir -p /tmp/docker/volumes; '
'mkdir -p /var/lib/docker/volumes'),
'Creating docker volumes directory in /tmp')
api.exec_command_on_nodes(
remote.exec_command_on_nodes(
nodes,
('(mount | grep /tmp/docker/volumes) || '
'mount --bind /tmp/docker/volumes /var/lib/docker/volumes'),
'Bind mount')

# Bind nova local storage in /tmp
api.exec_command_on_nodes(
remote.exec_command_on_nodes(
nodes,
'mkdir -p /tmp/nova ; mkdir -p /var/lib/nova',
'Creating nova directory in /tmp')
api.exec_command_on_nodes(
remote.exec_command_on_nodes(
nodes,
('(mount | grep /tmp/nova) || '
'mount --bind /tmp/nova /var/lib/nova'),
Expand All @@ -177,8 +177,9 @@ def destroy(self, env):
conf = env.get('config')
LOGGER.debug("Building enoslib configuration")
enoslib_conf = _build_enoslib_conf(conf)
conf = Configuration.from_dictionnary(enoslib_conf)
LOGGER.debug("Creating G5K provider")
g5k = provider.G5k(enoslib_conf)
g5k = provider.G5k(conf)
LOGGER.info("Destroying G5K deployment")
g5k.destroy()

Expand Down
3 changes: 3 additions & 0 deletions enos/provider/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,6 @@ def destroy(self, env):

def build_config(self, conf):
return _build_enoslib_conf(conf)

def __str__(self):
return "Openstack"
3 changes: 3 additions & 0 deletions enos/provider/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ def destroy(self, env):

def default_config(self):
return DEFAULT_CONFIG

def __str__(self):
return "Static"
2 changes: 1 addition & 1 deletion enos/provider/vmong5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ def default_config(self):
return DEFAULT_CONFIG

def __str__(self):
return 'VMonG5K'
return 'Vmong5k'
1 change: 1 addition & 0 deletions enos/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def up(config, config_file=None, env=None, **kwargs):
options.update(env['config'])
enos_action = "pull" if kwargs.get("--pull") else "deploy"
options.update(enos_action=enos_action)
options.update(context=str(provider))
# Runs playbook that initializes resources (eg,
# installs the registry, install monitoring tools, ...)
up_playbook = os.path.join(ANSIBLE_DIR, 'enos.yml')
Expand Down
Loading

0 comments on commit d1debb2

Please sign in to comment.