Commands
Commands, use cases, and helpful tips.
Initializing your Operator Collection
Below are the steps to initialize a new Operator Collection, or to configure an Operator Collection from an existing Ansible® Collection.
Initializing a new Operator Collection
Run the following command to initialize your Operator Collection for development.
To bypass input prompts:
Generating an operator-config.yml in an existing Ansible Collection
If you are planning to convert an existing Ansible Collection to an Operator Collection, then you should run the following command in the root directory of the Ansible Collection to generate the operator-config.yml
template.
Converting an existing Operator Collection to execute in an offline OpenShift® environment
If this Operator Collection will be executed in an offline OpenShift® environment, then you should run the command below to download the Ansible dependencies before deploying this operator to OpenShift.
If your local environment is also offline, then you must download the required Ansible dependencies from an internet-enabled computer. Once those collections are downloaded, you should then transfer those files to the offline computer, and store them in the ./collections
directory before executing the following command.
Usage Examples
Note: To execute this playbook, it is required that your are in the root directory of the collection that you are developing, with a valid galaxy.yml
and operator-config.yml
file in the same directory
Creating the initial operator on the OpenShift cluster
Run the following command to create the operator on the cluster:
Once prompted, enter the name, host, and port of the
ZosEndpoint
to execute your collection against.Note: You can also pass the required variable as extra vars to bypass input prompts:
Re-deploying your Ansible Collection after making local playbook/role modifications
In the event where modifications are needed to your collection, you can run the following command to quickly apply those modifications to your operator:
Re-deploying your Ansible Collection after making local playbook/role modifications, and modifications to your operator-config file
In the event where modifications are needed to your collection AND your operator-config.yml
file (i.e. adding new input variables), the operator would then need to be reconfigured and reinstalled to account for these new operator-config changes. To pick up these changes, you should run the following command to redeploy your operator:
Creating a credential Secret from within the Operator container
If you’re currently unable to install the z/OS Cloud Broker Encryption CLI, you also have the option to generate these encrypted credentials using the zoscb-encrypt
CLI within the operator container.
Run the following command to generate encrypted credentials in the current Namespace:
Note: Creating encrypted credentials with passphrases are currently not supported via the IBM Operator Collection SDK.
Deleting the Operator
Run the following command to uninstall the operator:
Tips
Configure alias commands to simplify playbook execution
To simplify the commands needed to be executed, linux/mac users should consider creating an alias for each command in your bash profile.
Open your bash profile using the following command:
or
Copy the following commands to your bash profile and save:
Source your bash profile to pick up the latest changes:
or
The aliases that were created can now be called instead of the full
ansible-playbook
commands.
Configure ocsdk-extra-vars file to bypass prompts
If you find yourself inputting vars_prompts frequently, create an ocsdk-extra-vars.yaml
file. If create_operator.yml
detects this file, it will automatically use it.
Example ocsdk-extra-vars.yaml
file:
Note: We do not recommend explicitly specifying passphrases in this file as they should be passed through the vars prompt. If the passphrase is specified however, we recommend that the ocsdk-extra-vars.yaml
file be added to your .gitignore
file to prevent the exposure of your passphrase on Github.
Suppress playbook warning messages
Set the following environment variables to suppress the WARNING messages listed below when executing playbooks within the IBM Operator Collection SDK collection.