1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/unit/plugins/inventory/fixtures/lxd_inventory.atd

175 lines
5.9 KiB
Text
Raw Normal View History

lxd: dynamic inventory (#2026) * lxd dynamic inventory and test data * added ``merge_profile`` parameter to merge configurations from the play to an existing profile * cosmetic changes * added ``merge_profile`` parameter to merge configurations from the play to an existing profile * cosmetic changes * fix pylint errors * fix flake8 warnings * fix pep8 errors without "line to long" * fix ansible tests * fix typo * fix version added * fix lost of suggestions from felixfontein * fix filter fix ansible test errors * delete test config * delete 'notes:' and copy content to description * move testdata load testdata by path from config * updated documentation * fix test data and remove inventory branch * fix spellings and rename lxd to community.general.lxd * fix documentation * remove selftest * strip example data * add unit test * switch to ansible.module_utils.common.dict_transformations * documentation cleanup * move lxd_inventory.atd from files to fixtures * update documentation move lxd_inventory.atd * rename self.groups to self dispose remove dumpdata * cleanup * fix unittests comment out dump_data, it breaks the unit tests * fix pep8 * Apply suggestions from code review * Update plugins/inventory/lxd.py * add test if no groupby is selected * rename disposed to groupby remove unused constant other suggested cleanups * Use bundled ipaddress instead of own code. * Update plugins/inventory/lxd.py * Exceptions should not be eaten. * Improve error handling for network range/address parsing. * Fix typo. * Make network range valid. * Do not error when groupby is not a dict. Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-26 18:25:45 +02:00
{
LXD inventory: Support virtual machines (#3519) (#3900) * LXD 4.x compatibility (Containers and VMs) * add changelog fragment * update fixture * update plugin options * backwards compatible alias Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/3519-inventory-support-lxd-4.yml Co-authored-by: Felix Fontein <felix@fontein.de> * add lxd 4.0 requirement * filter for type of virtualization added. due to duplication in the namespace, "type" is not used as the keyword but "nature". * add type filter Since the first version of this inventory plugin only supports containers, a filter function was added to filter between containers and virtual machines or both. By default only containers are displayed, as in the first version of the plugin. This behavior will change in the future. * rename C(nature) to C(type) The term "nature" does not fit into the lxd namespace. Therefore i renamed nature to type. * update changelog fragment * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <felix@fontein.de> * Apply suggestions from code review Co-authored-by: Felix Fontein <felix@fontein.de> * rename typefilter to type_filter * fix tests with type_filter * Update plugins/inventory/lxd.py * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”> (cherry picked from commit 8825ef4711ab44598f9e480b3d5ea75c608701c8) Co-authored-by: Élie <elie@deloumeau.fr>
2021-12-14 06:42:47 +01:00
"instances":{
lxd: dynamic inventory (#2026) * lxd dynamic inventory and test data * added ``merge_profile`` parameter to merge configurations from the play to an existing profile * cosmetic changes * added ``merge_profile`` parameter to merge configurations from the play to an existing profile * cosmetic changes * fix pylint errors * fix flake8 warnings * fix pep8 errors without "line to long" * fix ansible tests * fix typo * fix version added * fix lost of suggestions from felixfontein * fix filter fix ansible test errors * delete test config * delete 'notes:' and copy content to description * move testdata load testdata by path from config * updated documentation * fix test data and remove inventory branch * fix spellings and rename lxd to community.general.lxd * fix documentation * remove selftest * strip example data * add unit test * switch to ansible.module_utils.common.dict_transformations * documentation cleanup * move lxd_inventory.atd from files to fixtures * update documentation move lxd_inventory.atd * rename self.groups to self dispose remove dumpdata * cleanup * fix unittests comment out dump_data, it breaks the unit tests * fix pep8 * Apply suggestions from code review * Update plugins/inventory/lxd.py * add test if no groupby is selected * rename disposed to groupby remove unused constant other suggested cleanups * Use bundled ipaddress instead of own code. * Update plugins/inventory/lxd.py * Exceptions should not be eaten. * Improve error handling for network range/address parsing. * Fix typo. * Make network range valid. * Do not error when groupby is not a dict. Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-26 18:25:45 +02:00
"vlantest":{
LXD inventory: Support virtual machines (#3519) (#3900) * LXD 4.x compatibility (Containers and VMs) * add changelog fragment * update fixture * update plugin options * backwards compatible alias Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/3519-inventory-support-lxd-4.yml Co-authored-by: Felix Fontein <felix@fontein.de> * add lxd 4.0 requirement * filter for type of virtualization added. due to duplication in the namespace, "type" is not used as the keyword but "nature". * add type filter Since the first version of this inventory plugin only supports containers, a filter function was added to filter between containers and virtual machines or both. By default only containers are displayed, as in the first version of the plugin. This behavior will change in the future. * rename C(nature) to C(type) The term "nature" does not fit into the lxd namespace. Therefore i renamed nature to type. * update changelog fragment * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <felix@fontein.de> * Apply suggestions from code review Co-authored-by: Felix Fontein <felix@fontein.de> * rename typefilter to type_filter * fix tests with type_filter * Update plugins/inventory/lxd.py * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”> (cherry picked from commit 8825ef4711ab44598f9e480b3d5ea75c608701c8) Co-authored-by: Élie <elie@deloumeau.fr>
2021-12-14 06:42:47 +01:00
"instances":{
lxd: dynamic inventory (#2026) * lxd dynamic inventory and test data * added ``merge_profile`` parameter to merge configurations from the play to an existing profile * cosmetic changes * added ``merge_profile`` parameter to merge configurations from the play to an existing profile * cosmetic changes * fix pylint errors * fix flake8 warnings * fix pep8 errors without "line to long" * fix ansible tests * fix typo * fix version added * fix lost of suggestions from felixfontein * fix filter fix ansible test errors * delete test config * delete 'notes:' and copy content to description * move testdata load testdata by path from config * updated documentation * fix test data and remove inventory branch * fix spellings and rename lxd to community.general.lxd * fix documentation * remove selftest * strip example data * add unit test * switch to ansible.module_utils.common.dict_transformations * documentation cleanup * move lxd_inventory.atd from files to fixtures * update documentation move lxd_inventory.atd * rename self.groups to self dispose remove dumpdata * cleanup * fix unittests comment out dump_data, it breaks the unit tests * fix pep8 * Apply suggestions from code review * Update plugins/inventory/lxd.py * add test if no groupby is selected * rename disposed to groupby remove unused constant other suggested cleanups * Use bundled ipaddress instead of own code. * Update plugins/inventory/lxd.py * Exceptions should not be eaten. * Improve error handling for network range/address parsing. * Fix typo. * Make network range valid. * Do not error when groupby is not a dict. Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-26 18:25:45 +02:00
"metadata":{
"config":{
"image.os":"ubuntu",
"image.release":"focal",
"image.version":"20.04",
"volatile.last_state.power":"RUNNING"
},
"devices":{
"eth0":{
"name":"eth0",
"network":"my-macvlan",
"type":"nic"
}
},
"profiles":[
"default"
],
"expanded_devices":{
"eth0":{
"name":"eth0",
"network":"my-macvlan",
"type":"nic"
}
},
"name":"vlantest",
"status":"Running",
"location":"Berlin"
}
},
"state":{
"metadata":{
"status":"Running",
"network":{
"eth0":{
"addresses":[
{
"family":"inet",
"address":"10.98.143.199",
"netmask":"24",
"scope":"global"
},
{
"family":"inet6",
"address":"fd42:bd00:7b11:2167:216:3eff:fe78:2ef3",
"netmask":"64",
"scope":"global"
},
{
"family":"inet6",
"address":"fe80::216:3eff:fed3:7af3",
"netmask":"64",
"scope":"link"
}
]
},
"lo":{
"addresses":[
{
"family":"inet",
"address":"127.0.0.1",
"netmask":"8",
"scope":"local"
},
{
"family":"inet6",
"address":"::1",
"netmask":"128",
"scope":"local"
}
]
}
}
}
}
}
},
"networks":{
"my-macvlan":{
"state":{
"metadata":{
"addresses":[
{
"family":"inet",
"address":"192.168.178.199",
"netmask":"24",
"scope":"global"
},
{
"family":"inet6",
"address":"fd42:bd00:7b11:2167:216:3eff:fe78:2ef3",
"netmask":"64",
"scope":"global"
},
{
"family":"inet6",
"address":"fe80::216:3eff:fed3:7af3",
"netmask":"64",
"scope":"link"
}
],
"vlan":{
"lower_device":"eno1",
"vid":666
}
}
}
},
"lo":{
"state":{
"metadata":{
"addresses":[
{
"family":"inet",
"address":"127.0.0.1",
"netmask":"8",
"scope":"local"
},
{
"family":"inet6",
"address":"::1",
"netmask":"128",
"scope":"local"
}
],
"vlan":null
}
}
},
"eno1":{
"state":{
"metadata":{
"addresses":[
{
"family":"inet",
"address":"192.168.178.126",
"netmask":"24",
"scope":"global"
},
{
"family":"inet6",
"address":"fe80::3c0b:7da9:3cc7:9e40",
"netmask":"64",
"scope":"link"
}
],
"vlan":null
}
}
},
"eno1.666":{
"state":{
"metadata":{
"addresses":[
{
"family":"inet6",
"address":"fe80::de4a:3eff:fe8d:f356",
"netmask":"64",
"scope":"link"
}
],
"vlan":{
"lower_device":"eno1",
"vid":666
}
}
}
}
}
}