Skip to content

Instantly share code, notes, and snippets.

@mehdiMj-ir
Last active November 25, 2023 14:44
Show Gist options
  • Save mehdiMj-ir/520d637667b8e6d7bcb64a29314c3a35 to your computer and use it in GitHub Desktop.
Save mehdiMj-ir/520d637667b8e6d7bcb64a29314c3a35 to your computer and use it in GitHub Desktop.
developer-ansible-playbook.yml
---
- name: Install multiple packages 4 Druid
hosts: localhost
become: true
tasks:
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
- name: Install Zsh
ansible.builtin.apt:
name: zsh
state: present
- name: Install Gnome Shell Extensions
ansible.builtin.apt:
name: gnome-shell-extensions
state: present
- name: Add pgAdmin repository key
ansible.builtin.apt_key:
url: https://www.pgadmin.org/static/packages_pgadmin_org.pub
state: present
- name: Add pgAdmin repository
ansible.builtin.apt_repository:
repo: "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/{{ ansible_distribution_release }} pgadmin4 main"
state: present
- name: Install pgAdmin
ansible.builtin.apt:
name: pgadmin4
state: present
when: ansible_distribution == 'Ubuntu'
- name: Import the MongoDB public key
ansible.builtin.apt_key:
url: https://pgp.mongodb.com/server-6.0.asc
state: present
- name: Add MongoDB repository
ansible.builtin.apt_repository:
repo: deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/6.0 multiverse
state: present
update_cache: true
- name: Install MongoDB open source packages
ansible.builtin.apt:
name: mongodb-org
state: present
update_cache: true
- name: Install Node.js # it will install node 18 from ubuntu 23.04 or later
ansible.builtin.apt:
name: nodejs
state: present
- name: Install required packages for Docker
ansible.builtin.apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
state: present
- name: Add Docker's official GPG key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker repository
ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present
- name: Update apt cache again
ansible.builtin.apt:
update_cache: true
- name: Install Docker CE
ansible.builtin.apt:
name: ['docker-ce', 'docker-ce-cli', 'containerd.io', 'docker-buildx-plugin', 'docker-compose-plugin', 'docker-ce-rootless-extras']
state: present
- name: Add user to Docker GP <-> '{{ YOUR_USER_NAME }}'
ansible.builtin.user:
name: '{{ YOUR_USER_NAME }}'
groups: docker
append: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment