2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 02:52:07 +00:00

Add playbook examples for default genesis

This commit is contained in:
Jarrod Johnson 2021-03-18 14:30:18 -04:00
parent 66efa1da5c
commit 8050d3f69a
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,25 @@
Ansible playbooks ending in .yml or .yaml that are placed into this directory will be executed at the
appropriate phase of the install process.
The 'hosts' may be omitted, and if included will be ignored, replaced with the host that is specifically
requesting the playbooks be executed.
Also, the playbooks will be executed on the deployment server. Hence it may be slower in aggregate than
running content under scripts/ which ask much less of the deployment server
Here is an example of what a playbook would look like broadly:
- name: Example
gather_facts: no
tasks:
- name: Example1
lineinfile:
path: /etc/hosts
line: 1.2.3.4 test1
create: yes
- name: Example2
lineinfile:
path: /etc/hosts
line: 1.2.3.5 test2
create: yes

View File

@ -63,3 +63,20 @@ run_remote_python() {
cd - > /dev/null
return $retcode
}
run_remote_config() {
echo
set_confluent_vars
apiclient=/opt/confluent/bin/apiclient
if [ -f /etc/confluent/apiclient ]; then
apiclient=/etc/confluent/apiclient
fi
echo '---------------------------------------------------------------------------'
echo Requesting to run remote configuration for "'$*'" from $mgr under profile $profile
/usr/libexec/platform-python $apiclient /confluent-api/self/remoteconfig/"$*" -d {}
/usr/libexec/platform-python $apiclient /confluent-api/self/remoteconfig/status -w 204
echo
echo 'Completed remote configuration
echo '---------------------------------------------------------------------------'
return
}

View File

@ -6,6 +6,9 @@
# run_remote and run_remote_python are available to download scripts and
# execute them.
# Induce execution of remote configuration, e.g. ansible plays in ansible/onboot.d/
run_remote_config onboot
# This is an example to request the BMC be configured on the network
# according to how confluent has things configured:
# run_remote_python configbmc -c