summaryrefslogtreecommitdiffstats
path: root/ansible_collections/wti/remote/playbooks/cpm_hostname
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:03:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:03:42 +0000
commit66cec45960ce1d9c794e9399de15c138acb18aed (patch)
tree59cd19d69e9d56b7989b080da7c20ef1a3fe2a5a /ansible_collections/wti/remote/playbooks/cpm_hostname
parentInitial commit. (diff)
downloadansible-66cec45960ce1d9c794e9399de15c138acb18aed.tar.xz
ansible-66cec45960ce1d9c794e9399de15c138acb18aed.zip
Adding upstream version 7.3.0+dfsg.upstream/7.3.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/wti/remote/playbooks/cpm_hostname')
-rw-r--r--ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_config.yml28
-rw-r--r--ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_info.yml25
2 files changed, 53 insertions, 0 deletions
diff --git a/ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_config.yml b/ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_config.yml
new file mode 100644
index 00000000..435d0f21
--- /dev/null
+++ b/ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_config.yml
@@ -0,0 +1,28 @@
+# ansible-playbook ./hostname_config.yml -e ansible_hosts=youransibledefinedhostnames
+- name: Set Hostname (Site ID), Location, Asset Tag parameters
+ hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
+ collections:
+ - wti.remote
+ connection: local
+ gather_facts: False
+
+ tasks:
+ - set_fact: use_https=True
+ when: use_https is undefined
+ - set_fact: validate_certs=True
+ when: validate_certs is undefined
+
+ - cpm_hostname_config:
+ cpm_url: "{{ansible_host}}"
+ cpm_username: "{{ansible_user}}"
+ cpm_password: "{{ansible_pw}}"
+ use_https: "{{use_https}}"
+ validate_certs: "{{validate_certs}}"
+ hostname: "newhostname"
+ location: "newlocation"
+ assettag: "newassettag"
+
+ register: testout
+ - name: dump test output
+ debug:
+ msg: "{{ testout['data'] }}"
diff --git a/ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_info.yml b/ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_info.yml
new file mode 100644
index 00000000..87822829
--- /dev/null
+++ b/ansible_collections/wti/remote/playbooks/cpm_hostname/hostname_info.yml
@@ -0,0 +1,25 @@
+# ansible-playbook ./hostname_info.yml -e ansible_hosts=youransibledefinedhostnames
+- name: Get Hostname (Site ID), Location, Asset Tag parameters
+ hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
+ collections:
+ - wti.remote
+ connection: local
+ gather_facts: False
+
+ tasks:
+ - set_fact: use_https=True
+ when: use_https is undefined
+ - set_fact: validate_certs=True
+ when: validate_certs is undefined
+
+ - cpm_hostname_info:
+ cpm_url: "{{ansible_host}}"
+ cpm_username: "{{ansible_user}}"
+ cpm_password: "{{ansible_pw}}"
+ use_https: "{{use_https}}"
+ validate_certs: "{{validate_certs}}"
+
+ register: testout
+ - name: dump test output
+ debug:
+ msg: "{{ testout['data'] }}"