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

Critical Error in Idempotence Test When Setting Custom Port for Tangd #138

Closed
shaunjohnso opened this issue Feb 13, 2024 · 3 comments · Fixed by #139
Closed

Critical Error in Idempotence Test When Setting Custom Port for Tangd #138

shaunjohnso opened this issue Feb 13, 2024 · 3 comments · Fixed by #139

Comments

@shaunjohnso
Copy link

When configuring a custom port (port 80) for tangd using the playbook at https://github.com/linux-system-roles/nbde_server/blob/main/tasks/tangd-custom-port.yml, a critical error occurs during the idempotence test phase. The error indicates that specific tasks related to managing the tangd custom port and ensuring required services are enabled and at the correct state fail to execute idempotently. This issue was observed during the execution of an Ansible playbook that utilizes the fedora.linux_system_roles.nbde_server and my_tang_wrap roles.

Steps to Reproduce:
Clone the repository containing the nbde_server role.
Configure the playbook to set tangd to listen on port 80.
Create a custom directory /etc/systemd/system/tangd.socket.d.
Inside the /etc/systemd/system/tangd.socket.d directory, create a custom file named maxcon that includes an increase in connections to 1024.
Run the playbook once to apply the configuration.
Run the playbook again to test for idempotence.

Actual Behavior:
The second playbook execution fails the idempotence test with critical errors for the following tasks:

Manage tangd custom port systemd directory (repeatedly listed)
Ensure required services are enabled and at the right state (repeatedly listed)
Create Directory for Telnet Configuration (repeatedly listed)
Configure Maximum Telnet Connections (repeatedly listed)
These errors suggest that the playbook attempts to reapply configurations or settings that should already be in place, indicating a potential issue with how state is checked or managed for these tasks.

Logs:
CRITICAL Idempotence test failed because of the following tasks:

  • => fedora.linux_system_roles.nbde_server : Manage tangd custom port systemd directory
  • => fedora.linux_system_roles.nbde_server : Manage tangd custom port systemd directory
  • => fedora.linux_system_roles.nbde_server : Ensure required services are enabled and at the right state
  • => fedora.linux_system_roles.nbde_server : Ensure required services are enabled and at the right state
  • => my_tang_wrap: Create Directory for Telnet Configuration
  • => my_tang_wrap : Create Directory for Telnet Configuration
  • => my_tang_wrap : Configure Maximum Telnet Connections
  • => my_tang_wrap : Configure Maximum Telnet Connections
@richm
Copy link
Contributor

richm commented Feb 13, 2024

I think the issue is that the role uses the global variable __nbde_server_port_changed to determine if the service needs to be restarted, and does not reset it.

richm added a commit to richm/linux-system-roles-nbde_server that referenced this issue Feb 14, 2024
…he role

Cause: The role was assuming that the only file being managed in the tangd
socket override directory was the override.conf file for the custom port.

Consequence: The role would delete the directory if there was no custom port
without checking if there were other files in that directory being used to
override tangd settings.  This would cause the directory to be recreated
upon subsequent runs, and the role would report a change, and not appear
to be idempotent.

Fix: When adding the override directory for the port override file, do not
change its attributes.  Do not delete the directory if there are other files
in it.

Result: The role will co-exist with the tangd socket override files being
managed outside of the role.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>

Fixes linux-system-roles#138
richm added a commit to richm/linux-system-roles-nbde_server that referenced this issue Feb 14, 2024
…he role

Cause: The role was assuming that the only file being managed in the tangd
socket override directory was the override.conf file for the custom port.

Consequence: The role would delete the directory if there was no custom port
without checking if there were other files in that directory being used to
override tangd settings.  This would cause the directory to be recreated
upon subsequent runs, and the role would report a change, and not appear
to be idempotent.

Fix: When adding the override directory for the port override file, do not
change its attributes.  Do not delete the directory if there are other files
in it.

Result: The role will co-exist with the tangd socket override files being
managed outside of the role.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>

Fixes linux-system-roles#138
richm added a commit to richm/linux-system-roles-nbde_server that referenced this issue Feb 14, 2024
…he role

Cause: The role was assuming that the only file being managed in the tangd
socket override directory was the override.conf file for the custom port.

Consequence: The role would delete the directory if there was no custom port
without checking if there were other files in that directory being used to
override tangd settings.  This would cause the directory to be recreated
upon subsequent runs, and the role would report a change, and not appear
to be idempotent.

Fix: When adding the override directory for the port override file, do not
change its attributes.  Do not delete the directory if there are other files
in it.

Result: The role will co-exist with the tangd socket override files being
managed outside of the role.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>

Fixes linux-system-roles#138
@richm
Copy link
Contributor

richm commented Feb 14, 2024

@shaunjohnso are you able to try out #139?

@shaunjohnso
Copy link
Author

@richm tested and passed, confirmed fixed

richm added a commit that referenced this issue Feb 14, 2024
…he role

Cause: The role was assuming that the only file being managed in the tangd
socket override directory was the override.conf file for the custom port.

Consequence: The role would delete the directory if there was no custom port
without checking if there were other files in that directory being used to
override tangd settings.  This would cause the directory to be recreated
upon subsequent runs, and the role would report a change, and not appear
to be idempotent.

Fix: When adding the override directory for the port override file, do not
change its attributes.  Do not delete the directory if there are other files
in it.

Result: The role will co-exist with the tangd socket override files being
managed outside of the role.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>

Fixes #138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants