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
<?xml version="1.0" encoding="utf-8"?> | |
<aiml version="1.0.1"> | |
<category> | |
<pattern>HELLO</pattern> | |
<template> | |
<random> | |
<li>Hi, human !</li> | |
<li>Hello to you, good person</li> | |
<li>Hello there !</li> | |
<li>Ah finally a friend to talk to ! Hello !</li> |
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
Python 101 Problems: | |
1. Take a LIST of integers and find SUM of the numbers of the list. | |
Suggestion: pass the list as argument to the function you will define to solve the problem | |
2. Take a LIST of integers and characters (Alphanumeric) and Find SUM of the numbers of the list. | |
Suggestion: Create two functions: One function will return number from the list. Another function will find out the sum of the numbers. | |
3. Find out number of characters in a word without using len method. | |
Suggestion: Pass the string/word as argument to the function. |
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
[tguha@localhost docker-remote-access]$ ls | |
ansible.cfg inventory remote-access.yml role-secure-docker-daemon | |
[tguha@dhcp193-190 docker-remote-access]$ cat ansible.cfg | |
[defaults] | |
inventory=inventory | |
[tguha@dhcp193-190 docker-remote-access]$ cat inventory | |
[daemonhost] | |
'IP_OF_DAEMON_HOST' ansible_ssh_private_key_file='PRIVATE_KEY_FILE' | |
[tguha@dhcp193-190 docker-remote-access]$ cat remote-access.yml | |
--- |
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
[tguha@localhost docker-remote-access]$ ls | |
ansible.cfg inventory remote-access.yml role-secure-docker-daemon | |
[tguha@dhcp193-190 docker-remote-access]$ cat ansible.cfg | |
[defaults] | |
inventory=inventory | |
[tguha@dhcp193-190 docker-remote-access]$ cat inventory | |
[daemonhost] | |
'IP_OF_DAEMON_HOST' ansible_ssh_private_key_file='PRIVATE_KEY_FILE' | |
[tguha@dhcp193-190 docker-remote-access]$ cat remote-access.yml | |
--- |
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 playbook creates VM from the QCOW2 Image | |
- name: Create VM Playbook | |
hosts: localhost | |
become: yes | |
become_method: sudo | |
vars_files: | |
- vars/guests.yml |
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
#!/usr/bin/python | |
# | |
# This file is part of Ansible | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# Ansible is distributed in the hope that it will be useful, |
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
cli: | |
transport: cli | |
nxapi: | |
transport: nxapi | |
use_ssl: no | |
port: 8080 | |
ansible_ssh_user: admin | |
ansible_ssh_pass: admin |
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
- set interfaces ethernet eth0 address '192.168.0.1/24' | |
""" | |
+import socket | |
+import q | |
from copy import deepcopy | |
from ansible.module_utils.basic import AnsibleModule | |
-from ansible.module_utils.network.common.utils import remove_default_spec | |
+from ansible.module_utils.network.common.utils import validate_ip_address, remove_default_spec | |
from ansible.module_utils.network.vyos.vyos import load_config, run_commands |
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
+def get_vlan_int(interfaces): | |
+ vlan_int = [] | |
+ for i in interfaces.split(','): | |
+ if 'eth' in i.lower() and '-' in i: | |
+ int_range = i.split('-') | |
+ stop = int((int_range)[1]) | |
+ start = int(int_range[0].split('/')[1]) | |
+ eth = int_range[0].split('/')[0] | |
+ for r in range(start, stop + 1): | |
+ vlan_int.append(eth + '/' + str(r)) |
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
TASK [nxos_install_os] ****************************************************************************************************************************************************** | |
task path: /home/tguha/RHWork/ansible/hacking/example/nxosinstall.yml:8 | |
<nxos3k> connection transport is cli | |
<nxos3k> using connection plugin network_cli (was local) | |
<nxos3k> starting connection from persistent connection plugin | |
<nxos3k> local domain socket does not exist, starting it | |
<nxos3k> control socket path is /home/tguha/.ansible/pc/f9eaf71d8e | |
<nxos3k> <nxos3k> ESTABLISH CONNECTION FOR USER: admin on PORT 22 TO nxos3k | |
<nxos3k> <nxos3k> ssh connection done, setting terminal | |
<nxos3k> <nxos3k> loaded terminal plugin for network_os nxos |
OlderNewer