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

New module: remove_host #18596

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

New module: remove_host #18596

wants to merge 1 commit into from

Conversation

jpic
Copy link
Contributor

@jpic jpic commented Nov 23, 2016

ISSUE TYPE
  • Feature Pull Request
  • New Module Pull Request
COMPONENT NAME

remove_host

ANSIBLE VERSION
ansible 2.3.0 (remove_host f7f455dd84) last updated 2016/11/23 11:21:43 (GMT +200)
  lib/ansible/modules/core: (detached HEAD b598611afb) last updated 2016/11/23 11:23:32 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD 25292b3ebd) last updated 2016/11/23 11:23:32 (GMT +200)
  config file = /home/jpic/.ansible.cfg
  configured module search path = ['/home/jpic/ansible/library', '/usr/share/ansible']
SUMMARY

Added remove_host module. This is for when a task actually destroys a host, then it can be removed from further plays.

@bcoca bcoca added this to the 2.3.0 milestone Nov 23, 2016
@bcoca
Copy link
Member

bcoca commented Nov 23, 2016

making note of needing docs (module stub) once this is merged

jpic added a commit to jpic/ansible-modules-core that referenced this pull request Nov 25, 2016
@jpic
Copy link
Contributor Author

jpic commented Nov 25, 2016

Thanks for accepting this, but the test should fail, looks like this commit misses something to have it executed, any clue please ?

@gundalow
Copy link
Contributor

@jpic The tests need referencing from test/integration/non_destructive.yml (assuming they are non destructive.

@jpic
Copy link
Contributor Author

jpic commented Nov 25, 2016

Thank you @gundalow ! Tests are running, but it can't find remote_host. Probably because it's missing from modules/core ? ansible/ansible-modules-core#5726

2016-11-25 18:10:03 ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

Locally it works great:

TASK [add_host] **************************************************************************************************************************************************
task path: /home/jpic/work/novapost/ansible-boot-lxc/test.yml:8
creating host via 'add_host': hostname=testboot.lxc
changed: [localhost] => {
    "add_host": {
        "groups": [
            "testboot"
        ], 
        "host_name": "testboot.lxc", 
        "host_vars": {
            "lxc_container_config": [
                "lxc.mount.entry=/home/jpic/work/novapost/ansible-boot-lxc srv none defaults,bind,create=dir,uid=0 0 0"
            ]
        }
    }, 
    "changed": true
}

TASK [debug] *****************************************************************************************************************************************************
task path: /home/jpic/work/novapost/ansible-boot-lxc/test.yml:13
ok: [localhost] => {
    "groups": {
        "all": [
            "testboot.lxc"
        ], 
        "testboot": [
            "testboot.lxc"
        ], 
        "ungrouped": [
            "localhost"
        ]
    }
}

TASK [remove_host] ***********************************************************************************************************************************************
task path: /home/jpic/work/novapost/ansible-boot-lxc/test.yml:14
changed: [localhost] => {
    "changed": true, 
    "remove_host": {
        "host_name": "testboot.lxc"
    }
}

TASK [debug] *****************************************************************************************************************************************************
task path: /home/jpic/work/novapost/ansible-boot-lxc/test.yml:16
ok: [localhost] => {
    "groups": {
        "all": [], 
        "testboot": [], 
        "ungrouped": [
            "localhost"
        ]
    }
}

Isn't the best thing to do now creating another branch with a submodule reference to my fork of core modules ?

@gundalow
Copy link
Contributor

Changes to lib/ansible/modules/* must be in another PR, once merger we (Ansible Core Team) will update the submodules reference

Once the above is done this you can test this PR.

Please remove the change to lib/ansible/modules/core

The git submodule pain will be going away very shortly

Copy link
Contributor

@gundalow gundalow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs_revision

test/integration/targets/remove_host/tasks/main.yml Outdated Show resolved Hide resolved
test/integration/targets/remove_host/tasks/main.yml Outdated Show resolved Hide resolved
@mattclay
Copy link
Member

@jpic One of the test failures is due to a yamllint test failure:

test/integration/targets/remove_host/tasks/main.yml
  36:25     error    syntax error: mapping values are not allowed here

@ansibot ansibot added the affects_2.3 This issue/PR affects Ansible v2.3 label Dec 13, 2016
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Dec 15, 2016
@gundalow
Copy link
Contributor

gundalow commented Feb 7, 2017

rebase needed

@gundalow gundalow changed the title [WE WANT THIS] New module: remove_host New module: remove_host Oct 11, 2019
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Oct 19, 2019
@jpic
Copy link
Contributor Author

jpic commented Oct 22, 2019

@gundalow is there any change request that is not implemented ?

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Mar 9, 2020
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_review Updates were made after the last review and the last review is more than 7 days old. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Mar 26, 2020
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed stale_review Updates were made after the last review and the last review is more than 7 days old. labels Apr 11, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:arista.avd labels Apr 30, 2020
@ansibot ansibot added the needs_triage Needs a first human triage before being processed. label May 17, 2020
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label May 18, 2020
@ansibot ansibot added pre_azp This PR was last tested before migration to Azure Pipelines. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 6, 2020
@ansibot ansibot added the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jul 12, 2023
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.3 This issue/PR affects Ansible v2.3 c:inventory/group c:inventory/host c:parsing/mod_args c:plugins/action c:plugins/callback c:plugins/strategy collection:awx.awx collection:satishkamavaram.custom collection:sean_m_sullivan.awx collection:shanemcd.awx collection Related to Ansible Collections work feature This issue/PR relates to a feature request. inventory/group inventory/host inventory Inventory category module This issue/PR relates to a module. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_module This PR includes a new module. new_plugin This PR includes a new plugin. P3 Priority 3 - Approved, No Time Limitation parsing/mod_args plugins/action plugins/strategy pr_day Has been reviewed during a PR review Day pre_azp This PR was last tested before migration to Azure Pipelines. stale_review Updates were made after the last review and the last review is more than 7 days old. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants