-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1537 from samvarankashyap/add_gcloud_mock
Merged by Jenkins
- Loading branch information
Showing
26 changed files
with
264 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../linchpin-mock.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"changed": true, "diff": {"before": "", "before_header": "<absent>", "after": {"record": "www1.testlpgcdnszone.com.", "type": "A", "record_data": ["192.0.2.23", "192.0.2.42", "198.51.100.5", "203.0.113.10"], "ttl": 300}, "after_header": "A:www1.testlpgcdnszone.com."}, "state": "present", "record": "www1.testlpgcdnszone.com", "zone": "testlpgcdnszone.com.", "zone_id": "testlpgcdnszone-com", "type": "A", "record_data": ["192.0.2.23", "192.0.2.42", "198.51.100.5", "203.0.113.10"], "ttl": 300, "overwrite": false, "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"changed": true, "diff": {"before": "", "before_header": "<absent>", "after": {"zone": "testlpgcdnszone.com.", "description": "test"}, "after_header": "testlpgcdnszone.com."}, "state": "present", "zone": "testlpgcdnszone.com.", "description": "test", "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"zone": "us-central1-a", "state": "present", "instance_data": [{"image": "centos-7-v20191121", "disks": ["gce-webserver-000"], "machine_type": "f1-micro", "metadata": {}, "name": "gce-webserver-000", "network": "default", "subnetwork": "default", "private_ip": "10.128.0.43", "public_ip": "35.193.250.147", "status": "RUNNING", "tags": [], "zone": "us-central1-a"}], "name": "gce-webserver", "changed": true, "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"state": "present", "address": "35.231.149.59", "changed": true, "name": "testgcloudeiplinchpin", "region": "us-east1", "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"state": "present", "name": "testgcloudlinchpinautonet", "ipv4_range": null, "changed": true, "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "911265077410338739", "creationTimestamp": "2019-12-09T12:06:52.730-08:00", "name": "testgcpcomputenetwork", "description": "test_gcp_compute_network_linchpin", "selfLink": "https://www.googleapis.com/compute/v1/projects/linchpin-225218/global/networks/testgcpcomputenetwork", "autoCreateSubnetworks": false, "routingConfig": {"routingMode": "REGIONAL"}, "kind": "compute#network", "changed": true, "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"resources": [{"id": "7978328111630717326", "creationTimestamp": "2019-12-09T12:32:33.864-08:00", "name": "tcomputenetwork", "description": "test_gcp_compute_network_linchpin", "selfLink": "https://www.googleapis.com/compute/v1/projects/linchpin-225218/global/networks/tcomputenetwork", "autoCreateSubnetworks": false, "routingConfig": {"routingMode": "REGIONAL"}, "kind": "compute#network"}], "deprecations": [{"msg": "The 'gcp_compute_network_facts' module has been renamed to 'gcp_compute_network_info'", "version": "2.13"}], "failed": false, "changed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id": "6231353784640147140", "creationTimestamp": "2019-12-09T12:35:55.209-08:00", "name": "tcomputerouter", "region": "https://www.googleapis.com/compute/v1/projects/linchpin-225218/regions/us-central1", "network": "https://www.googleapis.com/compute/v1/projects/linchpin-225218/global/networks/tcomputenetwork", "bgp": {"asn": 64514, "advertiseMode": "CUSTOM", "advertisedGroups": ["ALL_SUBNETS"], "advertisedIpRanges": [{"range": "1.2.3.4"}, {"range": "6.7.0.0/16"}]}, "selfLink": "https://www.googleapis.com/compute/v1/projects/linchpin-225218/regions/us-central1/routers/tcomputerouter", "kind": "compute#router", "changed": true, "failed": false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gcdns_record") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gcdns_zone") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gce") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gce_eip") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gce_net") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gcp_compute_network") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
30 changes: 30 additions & 0 deletions
30
linchpin/provision/action_plugins/gcp_compute_network_facts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gcp_compute_network_facts") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.plugins.action import ActionBase | ||
import linchpin.MockUtils.MockUtils as mock_utils | ||
|
||
|
||
class ActionModule(ActionBase): | ||
def run(self, tmp=None, task_vars=None): | ||
""" | ||
Simple action plugin that returns the mocked output | ||
when linchpin_mock is True | ||
""" | ||
super(ActionModule, self).run(tmp, task_vars) | ||
# contains all the module arguments | ||
module_args = self._task.args.copy() | ||
# task vars.keys() contains all the variable required | ||
# when passed a extra_var as key value pair task_vars | ||
# would return mocked output of the named module. | ||
# print(task_vars['vars'].keys()) | ||
# print(task_vars['vars'].get('linchpin_mock', False)) | ||
linchpin_mock = task_vars['vars'].get('linchpin_mock', | ||
False) | ||
if linchpin_mock: | ||
return mock_utils.get_mock_data(module_args, | ||
"gcp_compute_router") | ||
|
||
module_return = self._execute_module(module_args=module_args, | ||
task_vars=task_vars, tmp=tmp) | ||
return module_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.