Skip to content

Commit

Permalink
feat(ansible): add initial ansible setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tepene committed May 15, 2024
1 parent c8796b7 commit d1dee5a
Show file tree
Hide file tree
Showing 11 changed files with 951 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[defaults]
# Inventory location
inventory = inventory.yml
# Location for roles
roles_path = ./roles
# Location for collections
collections_path = ./collections
# Localtion for plugins & modules
library = ./library
# Console log settings
display_skipped_hosts = false
# Use the YAML callback plugin.
stdout_callback = community.general.yaml
# Use the stdout_callback when running ad-hoc commands.
bin_ansible_callbacks = True
# Callback plugins
callbacks_enabled = ansible.posix.profile_tasks
# Skip SSH host key checking
host_key_checking = False
# Disable cowsay
nocows = 1

# Galaxy - Private Automation Hub Settings
[galaxy]
server_list = galaxy

[galaxy_server.galaxy]
url=https://galaxy.ansible.com
Empty file added collections/.gitkeep
Empty file.
Empty file added group_vars/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
ansible_python_interpreter: "{{ ansible_playbook_python }}"
6 changes: 6 additions & 0 deletions group_vars/nxos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ansible_connection: ansible.netcommon.httpapi
ansible_network_os: cisco.nxos.nxos
ansible_user: "{{ lookup('ansible.builtin.env', 'NXOS_USER', default='admin') }}"
ansible_password: "{{ lookup('ansible.builtin.env', 'NXOS_PASSWORD') }}"
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
2 changes: 2 additions & 0 deletions host_vars/localhost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
ansible_connection: local
9 changes: 9 additions & 0 deletions inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
all:
hosts:
localhost:
children:
nxos:
hosts:
sbx-nxos:
ansible_host: sbx-nxos-mgmt.cisco.com
877 changes: 877 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.poetry]
name = "ansible-nxos"
version = "0.1.0"
description = "NXOS configuration with ansible"
authors = ["Stephan Lüscher <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.11"
ansible-core = "^2.16"
jmespath = "^1.0"

[tool.poetry.group.dev.dependencies]
ansible-lint = { version = "^24.2", markers = 'platform_system != "Windows"' } # https://github.com/ansible/ansible-lint/issues/2730#issuecomment-1330406601

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
10 changes: 10 additions & 0 deletions requirements_ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
collections:
- name: ansible.posix
version: 1.5.4
- name: community.general
version: 8.6.0
- name: cisco.nxos
version: 8.0.0
- name: ansible.netcommon
version: 6.1.1
Empty file added roles/.gitkeep
Empty file.

0 comments on commit d1dee5a

Please sign in to comment.