Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

installing netbox #1

Open
andrewm659 opened this issue Oct 2, 2020 · 8 comments
Open

installing netbox #1

andrewm659 opened this issue Oct 2, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@andrewm659
Copy link

So after seeing your comment in the netbox repo issues I have downloaded your ansible playbook. However I am heavily modifying it to look like a traditional ansible playbook that you would find on ansible galaxy. I have been testing while going through this and have hit a snag. Also I have broken up the playbook into smaller files and made include statements. Instead of running AS the actual root user, I run the playbook as my used but I have full sudo permissions which results in LOTS of become statements.

I am at this point:
TASK [netbox1 : CREATE SUPER USER] ********************************************************************************************************************************************************************************
task path: /opt/syseng/automation/ansible/playbooks/roles/netbox1/tasks/netbox.yml

The playbook is just sitting there. I am not sure the variable is being passed properly.

@adamwoolhether
Copy link
Owner

adamwoolhether commented Oct 4, 2020

@andrewm659 I'd have to see your modified .yaml code to accurately diagnose the situation.

Have you tried running the playbook as-is on a fresh CentOS system?

Also please see the Notes section in the README, it sounds like you may be trying to create a superuser that already exists.

@andrewm659
Copy link
Author

So I got it working. And yes that was the issue. There needs to be more logic in it to check for the super user and either destroy the database and reload it or ignore it and move on.

@andrewm659
Copy link
Author

Also need the plugins...

@adamwoolhether
Copy link
Owner

@andrewm659 I totally agree. The command modules are not ideal, but I'm not sure how else to execute ansible commands within a target host's virtual environment. As such, I've loosely checked if the Netbox upgrade.sh has been executed before and placed the relevant tasks within a conditional block.

The "GENERATE SELF-SIGNED CERTIFICATE" task can also be improved. I know there is a proper module, but there are many crypto modules and crypto isn't my area of expertise, so I simply run the command after ensuring a key doesn't already exist.

Please feel free to contribute/improve

@adamwoolhether adamwoolhether added the enhancement New feature or request label Oct 5, 2020
@andrewm659
Copy link
Author

Let me create a separate repo. I'll show you what I did.

@andrewm659
Copy link
Author

@adamwoolhether
Copy link
Owner

https://github.com/andrewm659/ansible-role-netbox

Regarding conditional logic, i'm not quite sure what you've done different? Can you point it out for me?

It seems you've just separated the plays into various role task-files.

@andrewm659
Copy link
Author

It also doesn't have to run as root anymore but as a user with elevated privileges. And yes I did basically separate out into tasks.

Repository owner deleted a comment from sarawutp Feb 27, 2024
Repository owner deleted a comment from technosoft-admin Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants