stephenpearson / kitchen-oci

Kitchen driver for Oracle Cloud Infrastructure
Other
12 stars 9 forks source link

Token auth and setting OCI::Config from yaml #36

Closed b-dean closed 2 years ago

b-dean commented 2 years ago

This is so I can run kitchen test both locally where I log in to OCI with oci session authenticate and on our build server where we set a bunch of OCI_CLI_* environment variables to allow the cli to work w/o a config file. Together our kitchen.yml looks something like this:

driver:
  name: oci
    # ... 
    # shapes, compartments, images, etc
    # ...

    oci_profile_name: <%= ENV['OCI_CLI_PROFILE'] %>
    oci_config_file: <%= ENV['OCI_CLI_CONFIG_FILE'] %>
    use_token_auth: <%= ENV['OCI_CLI_AUTH'] == 'security_token' %>
    oci_config:
      region: <%= ENV['OCI_CLI_REGION'] %>
      user: <%= ENV['OCI_CLI_USER'] %>
      fingerprint: <%= ENV['OCI_CLI_FINGERPRINT'] %>
      authentication_type: <%= ENV['OCI_CLI_AUTH'] %>
      key_file: <%= ENV['OCI_CLI_KEY_FILE'] %>
      tenancy: <%= ENV['OCI_CLI_TENANCY'] %>