On Wed, 15 Dec 2021 12:36:30 -0800 (PST)
"[email protected]" <[email protected]> wrote:

> password expiration date/value is 20210715141027Z ... how to add 90 days to 
> the expiration date.

For example

    - debug:
        var: _date90
      vars:
        _date: "{{ pwdexp[0:4] }}-{{ pwdexp[4:6] }}-{{ pwdexp[6:8] }}"
        _sec: "{{ (_date|to_datetime('%Y-%m-%d')).strftime('%s')|int
                  + 90 * 24 * 60 * 60 }}"
        _date90: "{{ '%Y-%m-%d'|strftime(_sec) }}"

gives

  _date90: '2021-10-13'

-- 
Vladimir Botka

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20211216012441.55b78fc8%40gmail.com.

Attachment: pgpq8pkIGR13o.pgp
Description: OpenPGP digital signature

Reply via email to