Skip to content

Commit

Permalink
Merge pull request #8 from robertcsapo/main
Browse files Browse the repository at this point in the history
Updates README based on PR #8 

Commits explain the importance of hosts file, clarify the credentials usage, and add a hyperlink to examples for credentials.yaml, hosts, and tag.yaml
  • Loading branch information
wastorga authored Sep 6, 2021
2 parents 57832f6 + 33f776f commit bfd9c0b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This collection has been tested and supports Cisco DNA Center 2.1.1.
- Python >= 3.6, as the DNA Center SDK doesn't support Python version 2.x

## Install
Ansible must be installed
Ansible must be installed ([Install guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html))
```
sudo pip install ansible
```
Expand All @@ -24,12 +24,12 @@ DNA Center SDK must be installed
sudo pip install dnacentersdk
```

Install the collection
Install the collection ([Galaxy link](https://galaxy.ansible.com/cisco/dnac))
```
ansible-galaxy collection install cisco.dnac
```
## Use
First, define a `credentials.yml` file where you specify your DNA Center credentials as ansible variables:
First, define a `credentials.yml` ([example](playbooks/credentials.template)) file where you specify your DNA Center credentials as ansible variables:
```
---
dnac_host: <A.B.C.D>
Expand All @@ -41,7 +41,13 @@ dnac_verify: False # optional, defaults to True
dnac_debug: False # optional, defaults to False
```

Then, create a playbook `myplaybook.yml` referencing the variables in your credentials.yml file and specifying the full namespace path to the module, plugin and/or role:
Create a `hosts` ([example](playbooks/hosts)) file that uses `[dnac_servers]` with your Cisco DNA Center Settings:
```
[dnac_servers]
dnac_server
```

Then, create a playbook `myplaybook.yml` ([example](playbooks/tag.yml)) referencing the variables in your credentials.yml file and specifying the full namespace path to the module, plugin and/or role:
```
- hosts: dnac_servers
vars_files:
Expand All @@ -64,7 +70,7 @@ Execute the playbook:
```
ansible-playbook -i hosts myplaybook.yml
```
In the `playbooks` directory you can find more examples and use cases.
In the `playbooks` [directory](playbooks/) you can find more examples and use cases.


## Update
Expand Down

0 comments on commit bfd9c0b

Please sign in to comment.