Browse Source

Switch back to inventory_hostname_short for borg user

This is because it is possible for a inventory_hostname to be larger
then 32 chars, the limit for adduser. Changes are much smaller of that
happening with inventory_hostname_short.

Change-Id: Ibdcccf5e82d64117e70985348415ecc0404b1a24
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/14/644614/1
Paul Belanger 3 years ago
parent
commit
7eb523afbd
  1. 6
      playbooks/borg-client.yaml
  2. 6
      playbooks/borg-server.yaml

6
playbooks/borg-client.yaml

@ -54,7 +54,7 @@
- name: Setup openstack.ssh role
become: true
become_user: "borg_{{ inventory_hostname }}"
become_user: "borg_{{ inventory_hostname_short }}"
include_role:
name: openstack.ssh
apply:
@ -66,8 +66,8 @@
ssh_key_private_content: false
ssh_key_public_content: false
ssh_known_hosts_content: false
ssh_user_home: "/opt/backups/borg_{{ inventory_hostname }}"
ssh_user_name: "borg_{{ inventory_hostname }}"
ssh_user_home: "/opt/backups/borg_{{ inventory_hostname_short }}"
ssh_user_name: "borg_{{ inventory_hostname_short }}"
ssh_user_group: borgbackup
with_inventory_hostnames:
- borg-server:!disabled

6
playbooks/borg-server.yaml

@ -34,9 +34,9 @@
borgbackup_task_manager:
- pre
- config
borgbackup_user_name: "borg_{{ borg_clients }}"
borgbackup_user_home: "/opt/backups/borg_{{ borg_clients }}"
borgbackup_user_name: "borg_{{ hostvars[borg_client].inventory_hostname_short }}"
borgbackup_user_home: "/opt/backups/borg_{{ hostvars[borg_client].inventory_hostname_short }}"
with_inventory_hostnames:
- borg-client:!disabled
loop_control:
loop_var: borg_clients
loop_var: borg_client

Loading…
Cancel
Save