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
<html><title>Find Location of an IP</title> | |
<body><font face=\"Arial\"> | |
<H1>Please provide an IP or a LOCATION :</H1> | |
<p>Search Location, DS site code, Country, Network types or Comments</p> | |
<form method=\"GET\" action=\"launch_search_IP.pl\"> | |
<p> <input name=\"ip_to_search\" width=\"100%\" height=\"100%\" ></p> | |
<input type=\"submit\" value=\"Search\"></form> | |
<p> Here are results for your search of <b> 192.168.0.1 </b> : | |
<br> | |
<br> |
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
FROM: | |
[{"id": 1, "field2": "23@46"}, {"id": 2, "field2": "33333@45"}, {"id": 3, "field2": "23444@4634234234"}] | |
TO: | |
[23, 1, 46, 33333, 2, 45, 23444, 3, 4634234234] |
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
[defaults] | |
filter_plugins = ./plugins/filter |
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
--- | |
- hosts: localhost | |
gather_facts: False | |
connection: local | |
vars: | |
networks: | |
- { name: "public", type: public } | |
- { name: "private", type: private } | |
- { name: "prod-cluster", cidr: "192.172.0.0/24", reverse: "0.172.192.in-addr.arpa", type: cluster } | |
alternative: |
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
PLAY [localhost] *************************************************************************************************************************************************************************************************************************************************************** | |
TASK [Split user name from account var] **************************************************************************************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "I want just the username - someone" | |
} | |
PLAY RECAP ********************************************************************************************************************************************************************************************************************************************************************* | |
localhost : ok=1 changed=0 unreachable=0 failed=0 |
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
# edit lib/ansible/plugins/lookup/dict.py to look like | |
class LookupModule(LookupBase): | |
def run(self, terms, variables=None, **kwargs): | |
# Expect any type of Mapping, notably hostvars | |
if not isinstance(terms, collections.Mapping): | |
raise AnsibleError("with_dict expects a dict, got type {0}, terms contains {1}".format(type(terms), terms)) |
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
--- | |
- hosts: all | |
connection: local | |
gather_facts: False | |
serial: 1 | |
tasks: | |
- add_host: | |
name: "{{ inventory_hostname }}" | |
groups: "only_one" | |
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
[{ | |
"subnets": [ | |
{ | |
"availability_zone": "eu-west-1c", | |
"available_ip_address_count": 29, | |
"cidr_block": "<REDACTED>", | |
"default_for_az": "false", | |
"id": "subnet-<id>", | |
"map_public_ip_on_launch": "false", | |
"state": "available", |
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
$ grep 'NetworkConfig(indent=' lib/ansible/modules/network/eos/eos_config.py | |
candidate = NetworkConfig(indent=2) | |
return NetworkConfig(indent=2, contents=contents) | |
config = NetworkConfig(indent=2, contents=contents) | |
config = NetworkConfig(indent=3, contents=config_text) | |
running_config = NetworkConfig(indent=1, contents=output[0], ignore_lines=diff_ignore_lines) | |
startup_config = NetworkConfig(indent=1, contents=output[1], ignore_lines=diff_ignore_lines) | |
running_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines) | |
base_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines) |
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
$ ansible-playbook play.yml | |
PLAY [localhost] *************************************************************************************************************************************************************************************************************************************************************** | |
TASK [debug] ******************************************************************************************************************************************************************************************************************************************************************* | |
ok: [localhost] => { | |
"msg": "[{\"foo\": \"bar\", \"abc\": \"xyz\"}, {\"foo\": 123, \"abc\": 456}]" | |
} | |
TASK [command] ***************************************************************************************************************************************************************************************************************************************************************** |