Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use ansible-opnsense-update & facts #20

Open
tweak19 opened this issue Jan 4, 2025 · 6 comments
Open

How to use ansible-opnsense-update & facts #20

tweak19 opened this issue Jan 4, 2025 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@tweak19
Copy link

tweak19 commented Jan 4, 2025

Hi,
I currently trying to use your roles, but I am not sure how is the correct way to add this to my existing ansible setup.
If i try to add it with ansible-galaxy collection install git+ xxx I get an error that no name is specificated.

Could you please be so fine and made an short explanation how to use?
Would be great to make automatic upgrades on my opnsense ;-)

Thx
Kind regards

@zerwes zerwes self-assigned this Jan 4, 2025
@zerwes zerwes added the documentation Improvements or additions to documentation label Jan 4, 2025
@zerwes
Copy link
Contributor

zerwes commented Jan 4, 2025

Hello @tweak19 and thank you for your interest in our roles.

We tried to offer some sample on how we use the roles in https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-playbook

A improvement of the documentation is on the way as a PR in Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-playbook#1 - maybe you finde some interesting informations there

In general you can write your playbook like this cloning the repos as roles:

- name: opnsense
  hosts: opnsense
  vars:
    ansible_become: no
  roles:
    # ...
    - role: opnsense-facts # git clone https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-facts.git roles/opnsense-facts
      tags:
        - opnsense
        - facts
        - always
    - role: opnsense # git clone https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense.git roles/opensense
      tags:
        - opnsense
    - role: ansible-opnsense-update # git clone https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-update.git roles/
      tags:
        - opnsense
        - update
    # ...

I will have a look at the option to install the roles via ansible-galaxy and update the docs accordingly (I'll keep this issue open for this) ...

Hope this helps.
If there are other questions, just let me know...

@tweak19
Copy link
Author

tweak19 commented Jan 4, 2025

Thanks for your feedback with this information it was possible to setup the roles.
But I still stuck at the ansible-opnsense-update.
Take a look at the attached picture...

image

@zerwes
Copy link
Contributor

zerwes commented Jan 4, 2025

Hello @tweak19 - copy & paste of text is sufficient - no need to upload images.

Anyhow ... as stated in the README of the role, in my example above and in the message of the error you posted:

The playbook requires:

  • the lates ansible-opnsense-facts to be run before this

So you need to install and use the https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-facts role

@tweak19
Copy link
Author

tweak19 commented Jan 4, 2025

Hi,
thanks for your quick feedback, but that's what i have already done.
I added the "facts" role by executing:

git clone https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-facts.git roles/opnsense-facts

and the role is placed where are my othere roles stored.

kind regards

update: i think i found the issue, the facts need to be placed on the opnsense as seen in the main.yml...

@tweak19
Copy link
Author

tweak19 commented Jan 27, 2025

Just one last question about the usage.
How do you manage the permission with ansible?
As I can see in a Role you put the opnsense.facts on the opnsense.

But with the "default" user from opnsense you didn't have root access.
Did you add the user to group wheel?

Or do you use the root user and change the login to /bin/sh ?

Thanks in Advance.

@zerwes
Copy link
Contributor

zerwes commented Jan 28, 2025

like all RLS opnsense ansible role, it requires root shell access (ssh)
https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense#requirements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants