add repos configuration possibility for bareon

This commit is contained in:
Sylwester Brzeczkowski 2015-11-09 10:57:28 +01:00
parent d7b7226835
commit 8310d2b5f6
4 changed files with 14 additions and 68 deletions

View File

@ -19,6 +19,7 @@
tasks:
# Istall and configure dnsmasq
- apt: update_cache=yes
- apt: name=dnsmasq state=present
- file: path={{tftp_root}} state=directory
- template: src=files/dnsmasq_pxe.conf dest=/etc/dnsmasq.d/pxe.conf

View File

@ -7,7 +7,8 @@ from solar.events.controls import React
discovery_service = 'http://0.0.0.0:8881'
bareon_service = 'http://0.0.0.0:9322/v1/nodes/{0}/partitioning'
bareon_partitioning = 'http://0.0.0.0:9322/v1/nodes/{0}/partitioning'
bareon_repos = 'http://0.0.0.0:9322/v1/nodes/{0}/repos'
bareon_sync = 'http://0.0.0.0:9322/v1/actions/sync_all'
@ -25,7 +26,12 @@ class NodeAdapter(dict):
@property
def partitioning(self):
return requests.get(bareon_service.format(self['id'])).json()
return requests.get(bareon_partitioning.format(self['id'])).json()
@property
def repos(self):
return requests.get(bareon_repos.format(self['id'])).json()
# Sync hw info about nodes from discovery service into bareon-api
requests.post(bareon_sync)
@ -53,6 +59,7 @@ for node in nodes_list:
{
'partitioning': node.partitioning,
'master_key': master_key,
'repos': node.repos,
}
)

View File

@ -17,6 +17,9 @@ input:
admin_mac:
schema: str!
value:
repos:
schema: list!
value: []
name:
schema: str
value: a node

View File

@ -43,72 +43,7 @@
"local": "/var/www/nailgun/ubuntu/x86_64/images/linux",
"remote_relative": "dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux"
},
"repos": [
{
"name": "ubuntu",
"section": "main universe multiverse",
"uri": "http://archive.ubuntu.com/ubuntu/",
"priority": null,
"suite": "trusty",
"type": "deb"
},
{
"name": "ubuntu-updates",
"section": "main universe multiverse",
"uri": "http://archive.ubuntu.com/ubuntu/",
"priority": null,
"suite": "trusty-updates",
"type": "deb"
},
{
"name": "ubuntu-security",
"section": "main universe multiverse",
"uri": "http://archive.ubuntu.com/ubuntu/",
"priority": null,
"suite": "trusty-security",
"type": "deb"
},
{
"name": "mos",
"section": "main restricted",
"uri": "http://127.0.0.1:8080/2015.1.0-7.0/ubuntu/x86_64",
"priority": 1050,
"suite": "mos7.0",
"type": "deb"
},
{
"name": "mos-updates",
"section": "main restricted",
"uri": "http://mirror.fuel-infra.org/mos/ubuntu/",
"priority": 1050,
"suite": "mos7.0-updates",
"type": "deb"
},
{
"name": "mos-security",
"section": "main restricted",
"uri": "http://mirror.fuel-infra.org/mos/ubuntu/",
"priority": 1050,
"suite": "mos7.0-security",
"type": "deb"
},
{
"name": "mos-holdback",
"section": "main restricted",
"uri": "http://mirror.fuel-infra.org/mos/ubuntu/",
"priority": 1100,
"suite": "mos7.0-holdback",
"type": "deb"
},
{
"name": "Auxiliary",
"section": "main restricted",
"uri": "http://127.0.0.1:8080/2015.1.0-7.0/ubuntu/auxiliary",
"priority": 1150,
"suite": "auxiliary",
"type": "deb"
}
],
"repos": {{ repos | to_pretty_json }},
"metadata": {
"always_editable": true,
"weight": 50,