Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit ea31665

Browse files
Removed unused default value for mongodb net_port in pbm tasks
1 parent e25f12f commit ea31665

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tasks/backup/pbm_configure.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
when: not ansible_check_mode
5050

5151
- name: PBM Config PBM_MONGODB_URI
52-
command: pbm config --file /mongodb/pbm_config.yml --mongodb-uri "mongodb://{{ mongodb_backup_user_name }}:{{ mongodb_backup_user_password }}@{{ inventory_hostname }}:{{ mongodb_net_port|default('27017') }}/admin?replicaSet={{ mongodb_replication_replset }}"
52+
command: pbm config --file /mongodb/pbm_config.yml --mongodb-uri "mongodb://{{ mongodb_backup_user_name }}:{{ mongodb_backup_user_password }}@{{ inventory_hostname }}:{{ mongodb_net_port }}/admin?replicaSet={{ mongodb_replication_replset }}"
5353
no_log: true
5454

5555
- name: PBM Enable Point-in-Time Recovery
56-
command: pbm config --set pitr.enabled=true --mongodb-uri "mongodb://{{ mongodb_backup_user_name }}:{{ mongodb_backup_user_password }}@{{ inventory_hostname }}:{{ mongodb_net_port|default('27017') }}/admin?replicaSet={{ mongodb_replication_replset }}"
56+
command: pbm config --set pitr.enabled=true --mongodb-uri "mongodb://{{ mongodb_backup_user_name }}:{{ mongodb_backup_user_password }}@{{ inventory_hostname }}:{{ mongodb_net_port }}/admin?replicaSet={{ mongodb_replication_replset }}"
5757
no_log: true
5858
when:
5959
- mongodb_backup_pbm_pitr_enable|bool
@@ -66,5 +66,5 @@
6666
- name: Add PBM_MONGODB_URI to bashrc
6767
lineinfile:
6868
path: /root/.bashrc
69-
line: 'export PBM_MONGODB_URI="mongodb://{{ mongodb_backup_user_name }}:{{ mongodb_backup_user_password }}@{{ inventory_hostname }}:{{ mongodb_net_port|default("27017") }}/admin?replicaSet={{ mongodb_replication_replset }}"'
69+
line: 'export PBM_MONGODB_URI="mongodb://{{ mongodb_backup_user_name }}:{{ mongodb_backup_user_password }}@{{ inventory_hostname }}:{{ mongodb_net_port }}/admin?replicaSet={{ mongodb_replication_replset }}"'
7070
no_log: true

tasks/backup/pbm_remove.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
update_password: on_create
1919
login_user: "{{ mongodb_root_user_name }}"
2020
login_password: "{{ mongodb_root_user_password }}"
21-
login_port: "{{ mongodb_net_port|default('27017') }}"
21+
login_port: "{{ mongodb_net_port }}"
2222
state: absent
2323
no_log: true
2424

@@ -27,7 +27,7 @@
2727
mongo --quiet {{ '--ssl' if newrelic_mongodb_ssl == 'true' else '' }} \
2828
--host {{ inventory_hostname }} \
2929
-u {{ mongodb_root_user_name }} -p {{ mongodb_root_user_password }} \
30-
--port {{ mongodb_net_port|default('27017') }} \
30+
--port {{ mongodb_net_port }} \
3131
--eval 'db.getSiblingDB("admin").dropRole("pbmAnyAction")'
3232
ignore_errors: true
3333
no_log: true
@@ -46,5 +46,6 @@
4646
- name: Remove PBM_MONGODB_URI to bashrc
4747
lineinfile:
4848
path: /root/.bashrc
49+
line: 'export PBM_MONGODB_URI="mongodb://{{ mongodb_pbm_user_name }}:{{ mongodb_pbm_user_name_password }}@{{ inventory_hostname }}:{{ mongodb_net_port }}/admin?replicaSet={{ mongodb_replication_replset }}"'
4950
state: absent
5051
no_log: true

0 commit comments

Comments
 (0)