The ais_switch_protocol
playbook serves the purpose of streamlining the transition between HTTP and HTTPS-based deployments for AIStore while preserving all data, including buckets and objects.
Before running this playbook, ensure the following prerequisites are met:
-
AIStore Cluster Configuration: Verify that your AIStore cluster is properly configured and accessible via the command line interface (CLI).
-
CLI Configuration: Using the CLI, perform the following steps with the correct cluster endpoint set to
AIS_ENDPOINT
:-
To disable HTTPS:
ais config cluster net.http.use_https false
-
To enable HTTPS:
ais config cluster net.http.use_https true ais config cluster net.http.skip_verify true ais config cluster net.http.server_key /var/certs/tls.key ais config cluster net.http.server_crt /var/certs/tls.crt
-
-
Cluster Shutdown: Gracefully shut down the cluster to ensure configurations are saved properly:
ais cluster shutdown -y
Note: Shutting down the cluster ensures that the configuration changes are correctly saved and will be applied in subsequent runs. After shutting down, the cluster will be inaccessible until it is redeployed through the playbook.
-
Certificate Creation and Mounting: Follow generate_https_cert to create your TLS certificates.
Note: If you are using the AIS CLI and prefer not to verify the certificate, you can set
cluster.skip_verify_crt
totrue
with the command:ais config cli set cluster.skip_verify_crt true
To execute the ais_switch_protocol
playbook, follow these steps:
-
Install Ansible: Ensure Ansible is installed on your system.
-
Configure Hosts: Create or update your
hosts.ini
file to specify thecontroller
host and theais
hosts, which represent the nodes of your AIStore cluster. -
Update TLS Variables: Modify the variables in
vars/https_config.yml
to reflect your TLS settings. -
Verify AIS Mountpaths: Ensure that the mountpaths in
vars/ais_mpaths.yml
are accurate for your cluster. -
Run the Playbook: Execute the playbook with the following command:
ansible-playbook -i hosts.ini ais_switch_protocol.yml -e cluster=ais
If you need to remove AIStore configuration files after significant upgrades, you can run:
ansible-playbook -i hosts.ini ais_switch_protocol.yml -e cluster=ais -e delete_conf=true