You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

3 years ago
---
3 years ago
- hosts: service
3 years ago
remote_user: docker
3 years ago
become: yes
3 years ago
gather_facts: no
vars:
user: "docker"
3 years ago
3 years ago
tasks:
# ------------------------
# apt update
# -------------------------
3 years ago
# - name: apt update packages
# become: true
# apt:
# update_cache: 'yes'
# force_apt_get: 'yes'
# upgrade: 'dist'
# cache_valid_time: 3600
# install_recommends: true
# autoremove: true
3 years ago
# ------------------------
# apt install packages
# -------------------------
3 years ago
# - name: apt install packages
# become: true
# apt:
# update_cache: 'yes'
# force_apt_get: 'yes'
# install_recommends: true
# autoremove: true
# name: "{{ packages }}"
# vars:
# packages:
# - build-essential
# - git
# - flex
# - bison
# - traceroute
# - curl
# - lynx
3 years ago
# - ruby
3 years ago
- name: Install gnupg
apt:
name: gnupg
3 years ago
- name: Import the public key used by the package management system
3 years ago
become: true
3 years ago
apt_key:
url: https://www.mongodb.org/static/pgp/server-4.4.asc
state: present
3 years ago
- name: Create a list file for mongodb
command: echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
update_cache: yes
# - name: Add MongoDB repository
# apt_repository: repo='deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' state=present
3 years ago
- name: install mongodb
3 years ago
apt:
3 years ago
name: mongodb
3 years ago
state: present
3 years ago
- name: run mongodb
become: true
command: service mongodb start
3 years ago
# notify:
# - start mongodb