tasks:
+ - name: "Setting timestamp variables."
+ include_role:
+ name: set-timestamp-vars
+
- name: "Get the LDAP server to disable replication:"
ansible.builtin.set_fact:
ldapserver_to_disable: "{{ hostvars.localhost.ldapserver_to_disable }}"
var: ldapserver_to_disable
verbosity: 0
- - name: Get timestamp from the system
- ansible.builtin.shell: date +%Y-%m-%d_%H-%M-%S
- register: tstamp
- check_mode: false
- changed_when: false
-
- - name: "Show current timestamp"
- debug:
- var: tstamp
- verbosity: 3
-
- - name: "Set date variables"
- set_fact:
- cur_date: "{{ tstamp.stdout[0:10] | default('2024-11-11') }}"
- cur_time: "{{ tstamp.stdout[11:] | default('16-33-23') }}"
- cur_timestamp: "{{ tstamp.stdout[0:10] }}_{{ tstamp.stdout[11:] | default('2024-11-11_16-33-23') }}"
-
- - name: "Show current date"
- debug:
- msg: "Current timestamp: '{{ cur_timestamp }}'."
- verbosity: 0
-
- name: "Initial set target_replica_id"
ansible.builtin.set_fact:
target_replica_id: ~
include_role:
name: 389ds-check-initial
+ - name: "Setting timestamp variables."
+ include_role:
+ name: set-timestamp-vars
+
- name: "Get the LDAP server to enable replication:"
ansible.builtin.set_fact:
ldapserver_to_enable: "{{ hostvars.localhost.ldapserver_to_enable }}"
var: ldapserver_to_enable
verbosity: 0
- - name: "Get timestamp from the system"
- ansible.builtin.shell: date +%Y-%m-%d_%H-%M-%S
- register: tstamp
- check_mode: false
- changed_when: false
-
- - name: "Show current timestamp"
- debug:
- var: tstamp
- verbosity: 3
-
- - name: "Set date variables"
- set_fact:
- cur_date: "{{ tstamp.stdout[0:10] | default('2024-11-11') }}"
- cur_time: "{{ tstamp.stdout[11:] | default('16-33-23') }}"
- cur_timestamp: "{{ tstamp.stdout[0:10] }}_{{ tstamp.stdout[11:] | default('2024-11-11_16-33-23') }}"
-
- - name: "Show current date"
- debug:
- msg: "Current timestamp: '{{ cur_timestamp }}'."
- verbosity: 0
# vim: filetype=yaml
--- /dev/null
+---
+
+# Setting timestamp variables on base of the local time on the apropiate hosts
+
+- name: "Get timestamp from the system"
+ ansible.builtin.shell: date +%Y-%m-%d_%H-%M-%S%:z
+ register: get_tstamp
+ check_mode: false
+ changed_when: false
+
+- name: "Show current timestamp"
+ debug:
+ var: get_tstamp
+ verbosity: 3
+
+- name: "Set date variables"
+ set_fact:
+ cur_date: "{{ get_tstamp.stdout[0:10] }}"
+ cur_time: "{{ get_tstamp.stdout[11:19] }}"
+ cur_timestamp: "{{ get_tstamp.stdout[0:10] }}_{{ get_tstamp.stdout[11:19] }}"
+ cur_timezone: "{{ get_tstamp.stdout[19:] }}"
+
+- name: "Show current timestamp"
+ debug:
+ msg: "cur_timestamp: '{{ cur_timestamp }} {{ cur_timezone }}'"
+ verbosity: 0
+
+# vim: filetype=yaml