Git Product home page Git Product logo

Comments (6)

opoplawski avatar opoplawski commented on July 1, 2024

currently in pfsensible.core the task names do not have the pfsense_ prefix - so try "alias:". This will likely change in the future...

from ansible-pfsense.

NebraskaCoder avatar NebraskaCoder commented on July 1, 2024

My revised code:

---
- name: Add RFC1918 Alias
  hosts: all
  collections:
    - pfsensible.core
  tasks:
    - name: Add Alias
      alias:
        name: RFC1918
        type: network
        address: "10.0.0.0/8 172.16.0.0/12 192.168.0.0/16"
        state: present

And my revised error:

ERROR! couldn't resolve module/action 'alias'. This often indicates a misspelling, missing collection, or incorrect module path.

from ansible-pfsense.

NebraskaCoder avatar NebraskaCoder commented on July 1, 2024

So, I pulled this out of AWX into a stand-alone playbook as following, making sure to add gather_facts: no as it didn't like gathering facts:

---
- name: Add RFC1918 Alias
  hosts: all
  gather_facts: no
  collections:
    - pfsensible.core
  tasks:
    - name: Add Alias
      alias:
        name: RFC1918
        type: network
        address: "10.0.0.0/8 172.16.0.0/12 192.168.0.0/16"
        state: present

Of course, it works. Sounds like this isn't an issue for you but I need to find someone that can explain why it won't work in AWX and how to correctly import the module.

PLAY [Add RFC1918 Alias] ********************************************************************************************************************************************************************************************************************

TASK [Add Alias] ****************************************************************************************************************************************************************************************************************************
[WARNING]: Platform freebsd on host omrtr01p.rootops.net is using the discovered Python interpreter at /usr/local/bin/python3.7, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
changed: [pfsense-router-dns-name]

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
pfsense-router-dns-name : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

from ansible-pfsense.

opoplawski avatar opoplawski commented on July 1, 2024

I have no experience with AWX so I have no suggestions.

from ansible-pfsense.

NebraskaCoder avatar NebraskaCoder commented on July 1, 2024

Thank you anyways.

from ansible-pfsense.

NebraskaCoder avatar NebraskaCoder commented on July 1, 2024

In case anybody needs a solution, make a file in your project's directory at collections/requirements.yml instead of the roles/requirements.yaml that I was trying to do (also notice that I used yml instead of yaml, that's my second mistake). In that file, put the following:

---
collections:
  - name: pfsensible.core

And my playbook is below. Notice that I put gather_facts: no so that the playbook doesn't crash. I also had to suppress a warning about python by adding an inventory variable with ansible_python_interpreter: auto_silent:

---
- name: Add RFC1918 Alias
  hosts: all
  gather_facts: no
  collections:
    - pfsensible.core
  tasks:
    - name: Add Alias
      alias:
        name: RFC1918
        type: network
        address: "10.0.0.0/8 172.16.0.0/12 192.168.0.0/16"
        state: present

from ansible-pfsense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.