Skip to content

Commit

Permalink
Revert unwanted changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
smk4664 committed Aug 9, 2024
1 parent 832cbb6 commit 6e7b625
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nautobot_chatops/dispatchers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,16 @@ def subclasses(cls):
# TODO: this should be dynamic using entry_points
# pylint: disable=import-outside-toplevel, unused-import, cyclic-import
if get_app_settings_or_config("nautobot_chatops", "enable_slack"):
pass
from .slack import SlackDispatcher # noqa: F401

if get_app_settings_or_config("nautobot_chatops", "enable_ms_teams"):
pass
from .ms_teams import MSTeamsDispatcher # noqa: F401

if get_app_settings_or_config("nautobot_chatops", "enable_webex"):
pass
from .webex import WebexDispatcher # noqa: F401

if get_app_settings_or_config("nautobot_chatops", "enable_mattermost"):
pass
from .mattermost import MattermostDispatcher # noqa: F401

subclasses = set()
classes = [cls]
Expand Down
48 changes: 48 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,3 +838,51 @@ def validate_app_config(context):
file="development/app_config_schema.py",
env={"APP_CONFIG_SCHEMA_COMMAND": "validate"},
)


# ------------------------------------------------------------------------------
# APP CUSTOM
# ------------------------------------------------------------------------------
@task
def bootstrap_mattermost(context):
"""Bootstrap Nautobot data to be used with Mattermost."""
nbshell(context, file="development/mattermost/nautobot_bootstrap.py")


@task
def backup_mattermost(context):
"""Export Mattermost data to the SQL file. Certain tables are ignored."""
output = "./development/mattermost/dump.sql"

command = [
"exec",
"--",
"mattermost",
"bash",
"-c",
"'",
"pg_dump",
"--inserts",
"--user=$POSTGRES_USER",
"--dbname=$POSTGRES_DB",
"'",
f"> {output}",
]

docker_compose(context, " ".join(command))


@task
def connect_awx_container(context, container_name="tools_awx_1"):
"""Connect nautobot and celery containers to awx container.
Bridge network is defined in `development/ansible/docker-compose.yaml`.
To run testing awx instance, follow [instructions]
(https://github.com/ansible/awx/tree/devel/tools/docker-compose#getting-started)
Before running `make docker-compose` comment out `- 8080:8080` port mapping in file
`tools/docker-compose/ansible/roles/sources/templates/docker-compose.yml.j2` to avoid port conflict with nautobot.
After setting up awx, cd back to chatops repo and run `invoke connect-awx-container`.
"""
bridge_network = f"{context.nautobot_chatops.project_name}_awx"
context.run(f"docker network connect --alias awx {bridge_network} {container_name}")
print(f"Container {container_name} connected to {bridge_network} network")

0 comments on commit 6e7b625

Please sign in to comment.