Skip to content

Commit

Permalink
Merge pull request #8 from nokia/update-netcommon
Browse files Browse the repository at this point in the history
Bump netcommon and docs cleanup
  • Loading branch information
hellt authored Apr 25, 2023
2 parents 89bea4e + be9fea5 commit 55c984e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ jobs:
- name: Install ansible core
run: pip install ansible-core==${{ matrix.ansible-core-version }}

- name: ghcr.io login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Uncomment this section to use private images
# - name: ghcr.io login
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Test
run: ./run.sh ci-test
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

### Private folder ###
private/
# galaxy api key
apikey
# ignore build artifacts
*.tar.gz

### containerlab ###
**/clab-*/
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# SR Linux Ansible Collection

> **Warning**
> This is a work in progress. The collection is not yet published to Ansible Galaxy.
Ansible Collection to manage Nokia SR Linux devices. Documentation is provided at <https://learn.srlinux.dev/ansible/collection/>

## Dev setup

Start with cloning the repo:

```bash
git clone [email protected]:srl-labs/srl-ansible-collection.git
cd srl-ansible-collection
git clone [email protected]:nokia/srlinux-ansible-collection.git
cd srlinux-ansible-collection
```

Deploy the lab to support the tests:
Expand All @@ -24,7 +23,7 @@ Run the automated suite of tests to make sure nothing is missing. This will also
./run.sh test
```

To validate that the code passes ansible's sanity check, run:
To validate that the code passes Ansible's sanity check, run:

```bash
./run.sh sanity-test
Expand Down
7 changes: 4 additions & 3 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ tags:
- nokia
- srlinux
- jsonrpc
- rest-api
- httpapi
- network

# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: { "ansible.netcommon": "==4.1.0" }
dependencies:
"ansible.netcommon": ">=5.1.0"

# The URL of the originating SCM repository
repository: https://github.com/nokia/srlinux-ansible-collection
Expand All @@ -54,7 +55,7 @@ repository: https://github.com/nokia/srlinux-ansible-collection
issues: https://github.com/nokia/srlinux-ansible-collection/issues

# The URL to any online docs
documentation: https://learn.srlinux.dev/programmability/ansible/
documentation: https://learn.srlinux.dev/ansible/collection/

# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
Expand Down
1 change: 1 addition & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requires_ansible: ">=2.11"
plugin_routing:
modules:
srl_config:
Expand Down
16 changes: 16 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,22 @@ function sanity-test {
ansible-test sanity --docker default -v "$@"
}

# -----------------------------------------------------------------------------
# Publish functions.
# -----------------------------------------------------------------------------

function build-collection {
# cleanup
rm -f nokia-srlinux-*.tar.gz
# build the collection
ansible-galaxy collection build --force
}

function publish-collection {
# build the collection
build-collection
ansible-galaxy collection publish -v --token $(cat apikey) $(ls -1 nokia-srlinux-*.tar.gz)
}

# -----------------------------------------------------------------------------
# Bash runner functions.
Expand Down

0 comments on commit 55c984e

Please sign in to comment.