<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding API-Key to the credentials.yml in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445023#M7027</link>
    <description>&lt;P&gt;If you are storing credentials/keys in .yml files then look into using Ansible Vault for some level of encryption of that data.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 13:03:26 GMT</pubDate>
    <dc:creator>JamesT91</dc:creator>
    <dc:date>2024-08-28T13:03:26Z</dc:date>
    <item>
      <title>Adding API-Key to the credentials.yml</title>
      <link>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445021#M7025</link>
      <description>&lt;P&gt;New to Ansible with a better understanding of RestAPI I'm in the beginning of my learning to write Ansible playbooks.&lt;BR /&gt;Currently I like to avoid using the export command or hard-code the API-Key in to the playbook.&lt;BR /&gt;The solution seams to be to create a credentials.yml file with the API-key.&lt;BR /&gt;I follow the guide on this link &lt;A href="https://github.com/meraki/dashboard-api-ansible/blob/main/playbooks/credentials.yml" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/meraki/dashboard-api-ansible/blob/main/playbooks/credentials.yml&lt;/A&gt;&lt;BR /&gt;So the file looks like this:&lt;BR /&gt;---&lt;BR /&gt;meraki_api_key: "my key"&lt;BR /&gt;end-of-file&lt;BR /&gt;&lt;BR /&gt;My playbook yml file I try to use looks like the following:&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- hosts: meraki_servers&lt;BR /&gt;gather_facts: false&lt;BR /&gt;tasks:&lt;BR /&gt;- name: Get all webhooks httpservers&lt;BR /&gt;cisco.meraki.networks_webhooks_http_servers_info:&lt;BR /&gt;meraki_suppress_logging: true&lt;BR /&gt;networkId: 'My network-ID'&lt;BR /&gt;register: result&lt;/P&gt;&lt;P&gt;- name: Show current WebHook Servers&lt;BR /&gt;ansible.builtin.debug:&lt;BR /&gt;msg: "{{ result }}"&lt;/P&gt;&lt;P&gt;end-of-file&lt;/P&gt;&lt;P&gt;If I add meraki_api_key: "My key " befire the networkId line it works if not I receive an error saying meraki_api_key is missing&lt;BR /&gt;Ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 09:29:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445021#M7025</guid>
      <dc:creator>mikefredrik</dc:creator>
      <dc:date>2024-08-28T09:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding API-Key to the credentials.yml</title>
      <link>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445022#M7026</link>
      <description>&lt;P&gt;Found one working solution after some testing.&lt;BR /&gt;Provide the credential file in the execution of the playbook.&lt;BR /&gt;ansible-playbook -e &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/81871"&gt;@Api2&lt;/A&gt;_key.yml webhook.yaml&lt;BR /&gt;api_key.yml contain the following:&lt;BR /&gt;---&lt;BR /&gt;meraki_api_key: 'my secret key'&lt;BR /&gt;eof&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;in the playbook I added  meraki_api_key: "{{ meraki_api_key }}" in the task part of the book&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 12:35:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445022#M7026</guid>
      <dc:creator>mikefredrik</dc:creator>
      <dc:date>2024-08-28T12:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding API-Key to the credentials.yml</title>
      <link>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445023#M7027</link>
      <description>&lt;P&gt;If you are storing credentials/keys in .yml files then look into using Ansible Vault for some level of encryption of that data.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 13:03:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445023#M7027</guid>
      <dc:creator>JamesT91</dc:creator>
      <dc:date>2024-08-28T13:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding API-Key to the credentials.yml</title>
      <link>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445024#M7028</link>
      <description>&lt;P&gt;Aware of the possibilities to use the vault to encrypt the file, the thing is I have not found out how to use this in the playbook.&lt;BR /&gt;The content of the encrypted credentials file is something like this (omitted)&lt;BR /&gt;ansible@ubuntu-c:~$ cat credentials.yml&lt;BR /&gt;$ANSIBLE_VAULT;1.1;AES256&lt;BR /&gt;30373530356435393538623861663236306130343136376434326166656638313763356537356239&lt;BR /&gt;623436&lt;BR /&gt;So how to referense to this in the playbook&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 13:47:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/adding-api-key-to-the-credentials-yml/m-p/5445024#M7028</guid>
      <dc:creator>mikefredrik</dc:creator>
      <dc:date>2024-08-28T13:47:41Z</dc:date>
    </item>
  </channel>
</rss>

