Last active
September 26, 2023 23:56
-
-
Save mrlesmithjr/51bf5458b196da6d75fa3fd62a26b837 to your computer and use it in GitHub Desktop.
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/bash | |
ANSIBLE_VERSION=4.7.0 | |
apt-get update | |
apt-get -y install build-essential curl fontconfig libbz2-dev libffi-dev \ | |
libreadline-dev libsqlite3-dev libssl-dev python-is-python3 python3-dev \ | |
python3-minimal python3-pip python3-setuptools python3-virtualenv \ | |
python3-venv vim virtualenv zlib1g-dev zsh | |
pip3 install ansible==${ANSIBLE_VERSION} | |
pip3 install -r requirements.txt | |
ansible-galaxy install -r requirements.yml | |
ansible-playbook playbook.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
--- | |
- hosts: localhost | |
vars: | |
project_dir: /opt/deployment | |
connection: local | |
tasks: | |
- name: Update APT Cache | |
ansible.builtin.apt: | |
update_cache: true | |
become: true | |
- name: Creating Critical Directories | |
ansible.builtin.file: | |
path: "{{ item }}" | |
state: directory | |
become: true | |
loop: | |
- "{{ project_dir }}" | |
- "{{ project_dir }}/files" | |
- "{{ project_dir }}/files/dell" | |
- "{{ project_dir }}/files/hp" | |
- "{{ project_dir }}/files/zt" | |
- "{{ project_dir }}/inventory" | |
- "{{ project_dir }}/playbooks" | |
- "{{ project_dir }}/playbooks/reports" | |
- "{{ project_dir }}/playbooks/templates" |
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
ansible-lint |
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
--- | |
collections: [] | |
roles: [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment