on_box:->
- name: desktops
vlan_id: 20
- name: servers
vlan_id: 30
- name: printers
vlan_id: 40
- name: DMZ
vlan_id: 50
--- | |
plugin: aws_ec2 | |
regions: | |
- "{{ec2_region}}" | |
filters: | |
tag:Workshop: "{{ec2_name_prefix}}" | |
groups: | |
# all workshop types | |
control_nodes: "'ansible' in tags.short_name" | |
# rhel, rhel_90, f5 |
ok: [804d-student2-ansible] => | |
msg: |- | |
{ | |
"admin_password": "ansible1234", | |
"ami_launch_index": 0, | |
"ansible_check_mode": false, | |
"ansible_diff_mode": false, | |
"ansible_facts": {}, | |
"ansible_forks": 5, | |
"ansible_host": "3.226.22.126", |
--- | |
- hosts: localcost | |
connection: local | |
gather_facts: false | |
tasks: | |
- name: Post license key | |
uri: | |
url: https://localhost/api/v2/config/ | |
method: POST | |
user: admin |
#!/usr/bin/python | |
from __future__ import absolute_import, division, print_function | |
__metaclass__ = type | |
from ansible.module_utils.basic import AnsibleModule | |
def main(): | |
module = AnsibleModule( |
TASK [gitlab-client : Configure workshop repository] ******************************************************************************************************************************************************* | |
ok: [sean-march31-student1-ansible] | |
TASK [gitlab-client : print this bad boy] ****************************************************************************************************************************************************************** | |
ok: [sean-march31-student1-ansible] => | |
msg: | |
changed: false | |
failed: false | |
failed_when_result: false | |
msg: Destination /home/student1/windows-workshop/workshop_project/.git/config does not exist ! |
on_box:->
- name: desktops
vlan_id: 20
- name: servers
vlan_id: 30
- name: printers
vlan_id: 40
- name: DMZ
vlan_id: 50
[student1@ansible ~]$ cat netconf.yml | |
--- | |
- name: RUN A NETCONF COMMAND | |
hosts: cisco | |
gather_facts: no | |
tasks: | |
- name: make sure jxmlease is installed locally | |
pip: | |
name: jxmlease |
[student1@ansible ~]$ cat ~/.ansible.cfg | |
[defaults] | |
stdout_callback = yaml | |
connection = smart | |
timeout = 60 | |
deprecation_warnings = False | |
host_key_checking = False | |
retry_files_enabled = False | |
inventory = /home/student1/networking-workshop/lab_inventory/hosts | |
[persistent_connection] |
# Reboot an Arista EOS switch | |
--- | |
- name: Reboot arista eos switch | |
hosts: routers | |
gather_facts: false | |
tasks: | |
- name: Reboot device | |
ansible.netcommon.cli_command: | |
command: reload now |
- name: Perform Checks to make sure this Playbook will complete successfully | |
hosts: localhost | |
connection: local | |
become: no | |
gather_facts: no | |
vars: | |
ec2_region: us-east-1 | |
tasks: | |
- name: find ami for node1 | |
ec2_ami_facts: |