Saturday, 13 July 2019

Ansible playbook to Configure DNS on Windows server




- name: Installing Windows DNS Server
    win_feature:
     name: DNS
     state: present
     windows_dns_server_state: present
     include_management_tools: yes

  - name:Configure DNS
    win_dns_client:
     adapter_names: "Ethernet"
     ipv4_addresses: 10.0.0.1

Ansible playbook to Configure Active directory on Windows server




tasks:
  - name: Install AD Services feature
    win_feature:
     name: AD-Domain-Services
     include_management_tools: yes
     include_sub_features: yes
     state: present
    register: result

  - name: Create new forest
    win_domain:
     dns_domain_name: team1.local
     safe_mode_password: team1@123
    register: result
  - name: Reboot after creation
    win_reboot:
     msg: "Server config in progress; rebooting..."
    when: result.reboot_required



Ansible playbook for downloading backup on cisco firewall ASA




---
- hosts: asa
  connection: cli
  vars:
            cli:
    host: 192.22.110.196
    username: cisco
    password: cisco123
    transport: cli
    authorize: yes
    auth_pass: cisco
  tasks:
  asa_config:
    lines:
      - access-group cloud-acl_access_in in interface cloud13
    provider: "{{ cli }}"
    backup: yes
    backup_options:
      filename: backup.cfg
      dir_path: /home/user

Ansible playbook to sanity check on cisco firewall ASA


Health check commands: 


---
- hosts: sw
  connection: network_cli
  tasks:
   - name: show commands
     asa_commands:
                commands:
                          -  show version
                          -  show uptime
                          -  show memory
                          - show asadrops
            delegate_to: localhost
            register: managedhost_output
   - name: print           
             debug:
             msg: "{{ managedhost_output.stdout }}"

Ansible playbook for Network Object Creation on cisco firewall ASA




---
- hosts: asa
  tasks:
   - name: configure network object
      asa_og:
              name: ansible
              group_type: network-object
              state: present
              desciption: ansible testing
              host_ip:
                - 192.168.10.10
               group_object:
               - internal router


Ansible playbook for Service Object Creation on cisco firewall ASA




---
- hosts: asa
  tasks:
  - name: asa_config module
    asa_config:
             provider:
             authorize: yes
             host: 192.22.110.96
             username: cisco
             password: cisco123
             auth_pass:      cisco123 
  - name: Add service-object
   asa_og:
     name: ansible_test_2
             host: 8.8.8.8
     group_type: service-object
     state: present
             protocol: tcp
     description: 'HTTP'

Ansible playbook for Access list Creation on cisco firewall ASA ( Web Policy Restriction )




---
- hosts: asa
  connection: cli
  vars:
            cli:
    host: 192.168.1.1
    username: cisco
    password: cisco123
    transport: cli
    authorize: yes
    auth_pass: cisco
  tasks:
   - name: restricting google
     - asa_acl:
         lines:
                          - access-list ACL-OUTSIDE extended deny tcp any host 8.8.8.8 eq 80
                          context: cisco
                          provider: "{{ cli }}"

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...