On Wed, 8 Dec 2021 at 01:25, Todd Lewis <uto...@gmail.com> wrote:

> > Also I noticed that the "Read device information (always use unit when
> probing) " isn't being used. So I removed it.
> That's too bad, because its output is exactly what we need to know why the
> next bit is failing. It also contains the information you need to know
> whether the "Add new partition…" steps need to execute. But if we get those
> steps expressed idempotently it really shouldn't matter. Would be
> informative to see the output of that for both data_volume and
> pgsql_volume. I'd also be interested to see what /etc/fstab entry/entries
> you've got for these devices.
>
>
Oh, sorry about that then. I didn't realize you were going to need the
output of those commands.


> I'm assuming the error you quoted is from either the "Add new partition "
> {{ pgsql_volume }}" (/pgsql)" step or the "Add new partition "{{
> data_volume }}" (/data)" step, but I don't know which. I understand the
> desire to keep posts brief, but leaving out step output headers, values of
> variables, etc. makes us have to guess or scroll back through the thread
> and piece it back together. In the mean time, something's changed, etc. It
> could be that the one little breaking detail is something you're writing
> off as insignificant — otherwise you would have fixed it already!
>
> *[aside: I've been doing a lot of Ansible support in the last couple of
> weeks in forums like this, and nearly half the exchanges have been requests
> for information that was left out - presumably for my/our convenience -
> from prior posts.]*
>
> At any rate, the "Add new partition…" steps are not behaving idempotently:
> the partition you are declaring already exists. There must be some way to
> express that so that the community.general.parted module doesn't run
> "/usr/sbin/parted -s -m -a optimal /dev/nvme2n1 -- unit KiB mklabel msdos
> mkpart primary ext4 0% 100%", which we know is doomed to fail if there's
> already a partition on /dev/nvme2n1. (Or is there? Could be a raw device?)
>

Well, TBH it's working fine now. I created a bunch of files in the /data
and /pgsql directories and re-run the Ansible playbook. The idea here was
to know if Ansible would completely destroy the partitions and re-create
them, or if it would understand the partitions are already there and skip
or signal "ok".

I executed the playbook a couple of times and the files remained in their
directories. Which is really good.
The only different thing I had to do was to add those unmount commands. The
code I sent in my previous email is the entire bit.

Thank you for your help Todd, I'm happy with the result.

Cheers,
Lucas

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAE_gQfWPU__z5QxkJFE3BnacTa_tMGpdcGCy7%3DTWyLiZ85MRmg%40mail.gmail.com.

Reply via email to