Saturday, 13 July 2019

Ansible Playbook to open firewall port (DNS) (firewalld)



- name: Open firewall port
  firewalld:
    service: dns
    permanent: true
    state: enabled
    immediate: yes

Ansible playbook to Install DFS on Windows server




- name: Install DFS
    win_feature:
     name: FS-DFS-Namespace
     include_management_tools: yes
     include_sub_features: yes
     state: present
    register: result

Ansible playbook to Add AD user to OU group





    win_domain_user:
     name: user4
     firstname: mouni
     surname: motam
     company: Netenrich
     password: mouni123
     state: present
     groups:
      - Operatonal Team

Ansible playbook to Add group and specify the AD domain services to use for the create win_domain_group (OU )





     name: Operatonal Team
     domain_username: user123
     domain_password: user123
     domain_server: team1.local
     scope: domainlocal

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

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...