mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
Cleaner mongodb/tasks/install.yml
This commit is contained in:
parent
a51fdd7aac
commit
c23e241936
1 changed files with 15 additions and 17 deletions
|
@ -19,7 +19,7 @@
|
||||||
- name: Download & unzip 20MB http://download.iiab.io/packages/mongodb_stretch_3_0_14_core.zip to /tmp/mongodb-3.0.1x (aarch32)
|
- name: Download & unzip 20MB http://download.iiab.io/packages/mongodb_stretch_3_0_14_core.zip to /tmp/mongodb-3.0.1x (aarch32)
|
||||||
unarchive:
|
unarchive:
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
src: "{{ iiab_download_url }}/mongodb_stretch_3_0_14_core.zip"
|
src: "{{ iiab_download_url }}/mongodb_stretch_3_0_14_core.zip" # http://download.iiab.io/packages
|
||||||
dest: /tmp/mongodb-3.0.1x
|
dest: /tmp/mongodb-3.0.1x
|
||||||
|
|
||||||
- name: Install (move) its 3 CORE binaries from /tmp/mongodb-3.0.1x/core to /usr/bin (aarch32)
|
- name: Install (move) its 3 CORE binaries from /tmp/mongodb-3.0.1x/core to /usr/bin (aarch32)
|
||||||
|
@ -47,24 +47,22 @@
|
||||||
home: /var/lib/mongodb
|
home: /var/lib/mongodb
|
||||||
shell: /usr/sbin/nologin
|
shell: /usr/sbin/nologin
|
||||||
|
|
||||||
- name: Install /etc/mongod.conf from template (aarch32)
|
- name: Install {{ mongodb_conf }} from template (aarch32)
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: mongod.conf.j2
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ mongodb_conf }}" # /etc/mongod.conf
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "{{ item.mode }}"
|
mode: 0644
|
||||||
with_items:
|
|
||||||
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}", mode: '0644' } # i.e. /etc/mongod.conf
|
|
||||||
|
|
||||||
# end block
|
# end block
|
||||||
when: not (ansible_architecture == "x86_64" or ansible_architecture == "aarch64")
|
when: not (ansible_architecture == "x86_64" or ansible_architecture == "aarch64")
|
||||||
|
|
||||||
# 32 bit OS's get caught above should handle aarch32 including 32-bit ubuntu
|
# 32-bit OS's are handled above: this should handle aarch32 including 32-bit Ubuntu
|
||||||
# from https://ubuntu.com/download/raspberry-pi. 20.4-32bit might fail untested
|
# from https://ubuntu.com/download/raspberry-pi but Ubuntu 20.04 32-bit might fail
|
||||||
# 32bit intel might puke as this was orginally deployed for raspbian. Haven't
|
# untested, and 32-bit Intel might puke as this was orginally deployed for Raspbian.
|
||||||
# see bootable 32bit intel installers for a while now.
|
# (Haven't seen bootable 32-bit Intel installers for a while now.)
|
||||||
# 64 bit OS's proceed below.
|
# 64-bit OS's proceed below.
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Add mongodb.org signing key (only 64-bit support available)
|
- name: Add mongodb.org signing key (only 64-bit support available)
|
||||||
|
@ -116,12 +114,12 @@
|
||||||
- mongodb-org-server
|
- mongodb-org-server
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Change the mongodb port to 27018
|
- name: Change {{ mongodb_conf }} port to {{ mongodb_port }}
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/mongod.conf
|
path: "{{ mongodb_conf }}"
|
||||||
regexp: 'port: 27017'
|
regexp: "port: 27017"
|
||||||
backrefs: yes
|
backrefs: yes
|
||||||
line: ' port: 27018'
|
line: " port: {{ mongodb_port }}" # 27018
|
||||||
|
|
||||||
# end block
|
# end block
|
||||||
when: (ansible_architecture == "aarch64") or (ansible_architecture == "x86_64")
|
when: (ansible_architecture == "aarch64") or (ansible_architecture == "x86_64")
|
||||||
|
@ -154,7 +152,7 @@
|
||||||
|
|
||||||
# daemon_reload is used to force systemd to recognize a newly installed .service file
|
# daemon_reload is used to force systemd to recognize a newly installed .service file
|
||||||
# restarted here to ensure the port has been changed
|
# restarted here to ensure the port has been changed
|
||||||
- name: Disable 'mongodb' systemd service - started on demand by sugarizer
|
- name: Disable 'mongodb' systemd service - started on demand by Sugarizer
|
||||||
systemd:
|
systemd:
|
||||||
name: mongodb
|
name: mongodb
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
Loading…
Reference in a new issue