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
- name: Gather information about all Security Groups in Environment {{ ec2_environment }} | |
amazon.aws.ec2_group_info: | |
region: "{{ ec2_region }}" | |
filters: | |
vpc-id: "{{ all_vpcs.vpcs[0].vpc_id }}" | |
register: all_sg | |
- name: Delete Security Groups in VPC {{ all_vpcs.vpcs[0].vpc_id }} by ID | |
amazon.aws.ec2_group: | |
region: "{{ ec2_region }}" |
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
- name: Grab VPC details | |
amazon.aws.ec2_vpc_net_info: | |
region: "{{ ec2_region }}" | |
filters: | |
"tag:Environment": "{{ ec2_environment }}" | |
register: all_vpcs |
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
- name: Delete EC2 instance | |
community.aws.ec2_instance: | |
region: "{{ ec2_region }}" | |
state: absent | |
filters: | |
instance-state-name: running | |
"tag:Name": "{{ ec2_name_tag }}" | |
"tag:Environment": "{{ ec2_environment }}" |
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
- name: Reboot machine | |
ansible.builtin.reboot: |
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
- name: Add Docker repo on Fedora | |
block: | |
- name: Add Docker GPG key | |
ansible.builtin.rpm_key: | |
key: "{{ docker_repo_url }}/{{ ansible_distribution | lower }}/gpg" | |
state: present | |
- name: Add Docker repository | |
ansible.builtin.get_url: | |
url: "{{ docker_repo_url }}/{{ ansible_distribution | lower }}/docker-ce.repo" |
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
base_software: | |
Debian: | |
- dnsutils | |
- build-essential | |
- python3-dev | |
RedHat: | |
- bind-utils | |
- gcc | |
- python3-devel |
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
- name: Setup custom prompt | |
ansible.builtin.copy: | |
src: prompt.sh | |
dest: /etc/profile.d/prompt.sh | |
owner: root | |
group: root | |
mode: '0644' | |
- name: Make Ubuntu source the prompt file | |
ansible.builtin.lineinfile: |
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
- name: Install Python dependencies | |
ansible.builtin.pip: | |
name: "{{ python_libraries }}" | |
executable: pip3 |
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
- name: Configure systemd.unified_cgroup_hierarchy=0 in kernelopts | |
ansible.builtin.command: | |
cmd: grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" | |
notify: Reboot machine | |
when: ansible_distribution == "Fedora" |
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
- name: Download Containerlab | |
ansible.builtin.get_url: | |
url: "{{ clab_download_url }}" | |
dest: "/tmp/clab.tar.gz" | |
mode: '0644' | |
- name: Unarchive Containerlab | |
ansible.builtin.unarchive: | |
src: "/tmp/clab.tar.gz" | |
dest: "/tmp" |