0

I an creating a "recovery" ansible playbook, and I need to link to a read-only share on the backup machine so I can copy files.

The share on the backup machine is //io.hcs/backup. In windows this opens just fine.

I have tried every ansible.posix.mount set up I can think of.

I currently have

- name: Open share on io.
  ansible.posix.mount:
    src: "//io.hcs/backup"
    path: "/home/ian/backup"
    state: "present"
    fstype: "cifs"
    opts: "username=ian,password=<redacted>"
  delegate_to: 127.0.0.1

This is run with become=yes. The task does not error, and always reports changed. However it does not mount the share (the directory remains empty).

Both machines are Ubuntu 20.04, with all the latest patches. The hosts file contains the necessary entries. ufw has allow samba on both machines (which includes the old ports as well as 445)

I have the first account (ian, 1000) on both machines, with the same password on each.

So what might be going wrong?

2
  • 1
    What happens when you mount this share manually on the same server? Did you check the logs on the mounting server for any errors? Did you check if the mount is active or not? (with e.g. mount, df -h) ... Your question is missing debugging info to be answered. Commented Jun 18, 2022 at 23:17
  • When I mount it manually it mounts correctly and without errors. Eventually I guessed that Ansible was attempting to mount it as root, and failing because root has no password. So I auto-started the target machine, and set the share as "reconnect at login", and removed all the relevant tasks. Works just fine.
    – Ian
    Commented Jun 20, 2022 at 1:12

0

You must log in to answer this question.

Browse other questions tagged .