Skip to content

Instantly share code, notes, and snippets.

@mrlesmithjr
Last active September 26, 2023 23:56
Show Gist options
  • Save mrlesmithjr/51bf5458b196da6d75fa3fd62a26b837 to your computer and use it in GitHub Desktop.
Save mrlesmithjr/51bf5458b196da6d75fa3fd62a26b837 to your computer and use it in GitHub Desktop.
#!/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
---
- 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"
---
collections: []
roles: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment