Commit Graph

508 Commits

Author SHA1 Message Date
softwarefactory-project-zuul[bot] 34f140c22f
Merge pull request #206 from satken2/sakten2_issue111
Fixed sysctl to work on symlinks

SUMMARY
Fixes #111.
This issue reports a bug of sysctl that the module does not work properly when sysctl_file is a symlink.
I Fixed the bug by inserting os.path.realpath to get real path.
When sysctl_file is a real file, os.path.realpath return the original path as is.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
sysctl
ADDITIONAL INFORMATION


I have executed the script described in #111 and confirmed that it works properly.
But I need to add some tests.

satken@dockerhost1:~/ansible$ sudo docker run --rm -v ${PWD}:/work -w /work -e ANSIBLE_LIBRARY=/work/ansible.posix -e ANSIBLE_HOST_KEY_CHECKING=False satken2/ansible:3.3.0 ansible-playbook -i hosts main.yml

PLAY [test] ********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [192.168.91.76]

TASK [test] ********************************************************************
ok: [192.168.91.76] => {
    "msg": "This is test"
}

TASK [command] *****************************************************************
changed: [192.168.91.76]

TASK [command] *****************************************************************
ok: [192.168.91.76]

TASK [debug] *******************************************************************
ok: [192.168.91.76] => {
    "sysctl_current_value.stdout": "kernel.randomize_va_space = 2"
}

TASK [copy] ********************************************************************
changed: [192.168.91.76]

TASK [file] ********************************************************************
changed: [192.168.91.76]

TASK [stat] ********************************************************************
ok: [192.168.91.76]

TASK [assert] ******************************************************************
ok: [192.168.91.76] => {
    "changed": false,
    "msg": "/tmp/ansible_sysctl_test_symlink.conf is correct symlink"
}

TASK [sysctl | enable randomized layout of virtual address space] **************
changed: [192.168.91.76]

TASK [stat] ********************************************************************
ok: [192.168.91.76]

TASK [assert] ******************************************************************
ok: [192.168.91.76] => {
    "changed": false,
    "msg": "/tmp/ansible_sysctl_test_symlink.conf is correct symlink"
}

PLAY RECAP *********************************************************************
192.168.91.76              : ok=12   changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Reviewed-by: quidame
Reviewed-by: Jill R
2024-05-09 19:41:13 +00:00
Jill Rouleau 83c4d2abd1 lint fixes 2024-05-09 12:10:44 -07:00
Jill Rouleau e5733c5e49 Quote string in test assertion 2024-05-07 16:53:57 -07:00
Jill Rouleau d49bd27fae Revert "sysctl: Fixed sysctl to work on symlinks(#111)"
This reverts commit 34b467719e.
2024-05-07 16:53:57 -07:00
satken2 9064ff7eb2 sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2 a842e5f96a sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2 97dcdee670 sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2 55ea4ba1de sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2 a88f5f8ae0 sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
softwarefactory-project-zuul[bot] d36a289deb
Merge pull request #490 from atom4git/main
Docs/authorized_key: clarify that the path key should probably NOT be set

SUMMARY

Docs: Fixed unclearance in documentation connected wirh relative path
Added additional description in documentation.

ISSUE TYPE


Docs Pull Request

COMPONENT NAME

authorized_key.py
ADDITIONAL INFORMATION

Clarify the documentation unclearance in connected with relative path ~/.ssh/authorized_keys
The purpose of the pull request is to eliminate ambiguities in the documentation.
In our case, when using the ~ sign, we get the user's root directory (although we explicitly specify a different username)
Here is the issue and full picture of problem which we want to fix: LINK

Closese:  #483

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: atom4git
Reviewed-by: Hideki Saito <saito@fgrep.org>
2024-04-02 08:44:34 +00:00
Sergey 60c8d23c7f
Docs/authorized_key: clarify that the path key should probably NOT be set 2024-04-02 17:08:28 +09:00
softwarefactory-project-zuul[bot] 795d8e34e7
Merge pull request #538 from csmart/ci_freebsd_133
ci: replace freebsd 13.2 with 13.3

The devel version of ansible-test has been updated to include support for FreeBSD 13.3, so this change swaps out 13.2 accordingly.
See ansible-collections/news-for-maintainers#67

Reviewed-by: Hideki Saito <saito@fgrep.org>
2024-03-26 06:50:36 +00:00
Chris Smart b615d61fae ci: replace freebsd 13.2 with 13.3
The devel version of ansible-test has been updated to include support
for FreeBSD 13.3, so this change swaps out 13.2 accordingly.
2024-03-26 14:59:32 +09:00
softwarefactory-project-zuul[bot] bda85b7453
Merge pull request #541 from saito-hideki/pr/replace_yield
[CI] Replaced yield with yield from for sanity test

SUMMARY
Replaced yield with yield from to address latest sanity test.
ISSUE TYPE

CI Tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2024-03-26 05:51:09 +00:00
Hideki Saito ac82f575c6 Replaced yield with yield from to address latest sanity test
Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-03-26 13:54:40 +09:00
softwarefactory-project-zuul[bot] a356bdd3c4
Merge pull request #540 from saito-hideki/pr/relace_old_fqcn_selogin
[CI] Replaced old selogin FQCN for integration tests

SUMMARY
Some integration test tasks used the old FQCNs of commuinity.general.
This PR will replace old FQCN(community.general.system.selogin)with new cummonity.general.selogin
ISSUE TYPE

CI Tests Pull Request

COMPONENT NAME

ansible.posix.selinux

ADDITIONAL INFORMATION
None
2024-03-26 02:59:55 +00:00
Hideki Saito 4f93234a8b Replaced old selogin FQCN
- FCQN has been changed since comunity.general stable-6

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-03-26 10:39:34 +09:00
softwarefactory-project-zuul[bot] 9bfed58f7f
Merge pull request #333 from NeodymiumFerBore/fix/doc/mount_absent_description
Fix absent state documentation

SUMMARY
Fix the documentation of the state absent so it describes its actual behavior:

absent does not specify that (quote) a device mount's entry will be removed from fstab. It specifies that a mount point entry will be removed from fstab
absent does not unmount recursively, and the module will fail if multiple devices are mounted on the same mount point
absent with a mount point that is not registered in the fstab has no effect. The state unmounted should be used instead.
src is ignored with state absent or unmounted

ISSUE TYPE

Docs Pull Request

COMPONENT NAME
mount
ADDITIONAL INFORMATION
This PR addresses a fix for issue 322.
2024-02-06 16:13:16 +00:00
Adam Miller a18d180246
Merge branch 'main' into fix/doc/mount_absent_description 2024-02-06 09:29:55 -06:00
Marty Winkler 51b94f536c
Feat/add summary only option to profile callbacks (#511)
* profile_tasks callback: add parameter to show only summary
2024-02-06 09:21:42 -06:00
Petr Lautrbach 0a07bdb358
seboolean: make it work with disabled SELinux (#496)
Sometimes it's necessary to configure SELinux before it's enabled on the
system. There's `ignore_selinux_state` which should allow it. Before
this change `seboolean` module failed on SELinux disabled system even
with `ignore_selinux_state: true` and SELinux policy installed while
`semanage boolean` worked as expected:

    $ ansible -i 192.168.121.153, -m seboolean -a "name=ssh_sysadm_login state=on ignore_selinux_state=true" all
    192.168.121.153 | FAILED! => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "Failed to get list of boolean names"
    }

    $ ssh root@192.168.121.153 semanage boolean -l | grep ssh_sysadm_login
    ssh_sysadm_login               (off  ,  off)  Allow ssh to sysadm login

It's caused by `selinux.security_get_boolean_names()` and
`selinux.security_get_boolean_active(name)` which required SELinux
enabled system.

This change adds a fallback to semanage API which works in SELinux
disabled system when SELinux targeted policy is installed:

    ANSIBLE_LIBRARY=plugins/modules ansible -i 192.168.121.153, -m seboolean -a "name=ssh_sysadm_login state=on persistent=true ignore_selinux_state=true" all
    192.168.121.153 | CHANGED => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "ssh_sysadm_login",
        "persistent": true,
        "state": true
    }

    $ ssh root@192.168.121.153 semanage boolean -l | grep ssh_sysadm_login
    ssh_sysadm_login               (on   ,   on)  Allow ssh to sysadm login

Note that without `persistent=true` this module is effectively NO-OP now.

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
2024-02-06 09:21:27 -06:00
Sloane Hertel e929aad539
remove deprecated internal argument from synchronize (#421)
* remove deprecated internal argument from synchronize

the new_stdin argument is no longer used to instantiate a connection plugin

* add a changelog
2024-01-11 14:24:45 -06:00
Michael 0847977d12
Warn only when zones were ignored in firewalld_info (#504)
* warn only when zones were ignored

* add changelog 504-firewalld_info-warning
2024-01-09 16:07:58 -06:00
Christer Warén 2a1fb334ee
mount: edit boot parameters warning condition (#523)
the CI failures are unrelated and shouldn't even be showing up ... I'm going to sort that out separately but that doesn't need to prevent this merge, all relevant CI tests passed
2024-01-09 16:06:26 -06:00
softwarefactory-project-zuul[bot] af870d0b83
Merge pull request #524 from felixfontein/fix-ci
Fix CI issues

SUMMARY

Sanity tests fail; remove problematic Shippable-specific parts of shippable.sh script.
FreeBSD 12.4 have apparently been removed also from older versions of ansible-test.

ISSUE TYPE

Test Pull Request

COMPONENT NAME
CI
2024-01-09 18:43:25 +00:00
Felix Fontein 8e900e5218 Support for FreeBSD 12.4 was removed. 2024-01-09 07:30:04 +01:00
Felix Fontein 45d8819b7c Remove Shippable leftovers. 2024-01-09 07:25:45 +01:00
softwarefactory-project-zuul[bot] 6473053b13
Merge pull request #518 from bcoca/ci_fbsd132
update ci target for freebsd 13, r1 is eol

Current CI fails due to the  release_1/ dir returning 404, this will move to working release_2/ dir
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

CI
2024-01-08 20:11:06 +00:00
Brian Coca 046f6d1483 update ci target for freebsd 13, r1 is eol 2023-12-11 10:18:12 -05:00
softwarefactory-project-zuul[bot] 2c52f969e1
Merge pull request #484 from flowerysong/firewalld_offline
firewalld: make offline do something

SUMMARY

ansible.posix.firewalld has an offline flag, but it currently does not do anything. What most people expect it to do is allow the task to proceed even when firewalld is offline, so it makes the most sense for it to override the immediate flag and prevent the module from throwing an error in that case.
Fixes #81.
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

firewalld
ADDITIONAL INFORMATION

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-12-07 21:18:29 +00:00
softwarefactory-project-zuul[bot] 011c60e736
Merge pull request #516 from maxamillion/lint/major-refactor
refactor to comply with current ansible-lint guidelines

SUMMARY

refactor to comply with current ansible-lint guidelines

ISSUE TYPE


Bugfix Pull Request
2023-12-07 16:20:11 +00:00
Adam Miller a85f736f6a refactor to comply with current ansible-lint and sanity guidelines
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-12-06 17:22:59 -06:00
softwarefactory-project-zuul[bot] 05ee6ebc2a
Merge pull request #515 from maxamillion/tests/azure_pipelines
remove old pipelines, run sanity in pipelines because we're dropping zuul

SUMMARY

remove old pipelines, run sanity in pipelines because we're dropping zuul

ISSUE TYPE


Bugfix Pull Request
2023-12-01 01:34:06 +00:00
Adam Miller c394f6778d remove old pipelines, run sanity in pipelines because we're dropping zuul
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-11-30 19:01:55 -06:00
Adam Miller 748bad22ad
fix sanity tests for core 2.16 (#514)
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-11-30 16:25:07 -06:00
softwarefactory-project-zuul[bot] 6f95c8b356
Merge pull request #460 from gotmax23/respawn
Respawn modules to use the system python interpreter

SUMMARY
The seboolean, selinux, firewalld, and firewalld_info modules depend on
system bindings that are only available for the default system python
interpreter. ansible-core is not packaged for the default system python
interpreter on RHEL 8 and 9. When automatic interpreter discovery does
not occur (e.g. when using implicit localhost [1]), ansible-core will
not use the system interpreter to run ansible modules and the
aforementioned modules will not work even if the bindings are installed.
The RHEL ansible-core maintainers as well as the EPEL ansible and
ansible-collection-* package maintainers (inc. me) have gotten multiple
bug reports about this. We have been telling people to fix their setup
to use the correct Python interpreter. Fortunately, ansible-core 2.11
and above have a module utility that'll respawn modules to use the
correct system interpreter.
[1] https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
seboolean
selinux
firewalld
firewalld_info

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-11-30 17:03:21 +00:00
Paul Arthur 695fa213b3 firewalld: make offline do something 2023-11-29 00:06:36 +00:00
softwarefactory-project-zuul[bot] 719f7dfebf
Merge pull request #510 from saito-hideki/issue/509
[CI] Replace Fedora 38 with 39 for devel branch container test

SUMMARY
Replace Fedora 38 container test with 39 for devel branch.

Fixed /#509

ISSUE TYPE

CI test Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-11-23 15:56:55 +00:00
Hideki Saito 5cae7aa946 Replace Fedora 38 with 39 for devel branch container test 2023-11-22 17:09:41 +09:00
softwarefactory-project-zuul[bot] 2f699307c7
Merge pull request #508 from saito-hideki/pr/refactoring_ci_remote
[CI] Refactoring CI tests for both remote and container tests

SUMMARY
Refactored CI tests:

Remove tests for Ansible Core 2.10 and 2.11 that already reached EOL.
Remote test target of ansible.posix will be the latest version of RHEL8,9 only.
The target OS of container tests has been modified, and a few OS have been removed
Add Ansible Core 2.16 and new devel branch to container and remote test target.
#506

For CI testing, other platforms can be added as needed.
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-11-16 04:34:53 +00:00
Hideki Saito 7dd5087e7b Refactoring remote and docker CI tests.
* Removed tests for Ansible Core 2.10 and 2.11 fromn remote and container targets
* Modoifed remote and container test target OS
* Fixed #506

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-11-16 11:56:08 +09:00
softwarefactory-project-zuul[bot] 542643e786
Merge pull request #487 from saito-hideki/pr/ci_remove_freebsd12
Drop OSX10.11 and FreeBSD12.4 from CI

SUMMARY
Drop OSX-10.11 and FreeBSD12.4 from CI

Fixes #476
Fixes #486
Drop OSX10.11 from ansible:2.9 and ansible-core:2.10
Drop FreeBSD12.4 from ansible-core:devel

ISSUE TYPE

CI Tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-08-02 08:29:22 +00:00
Hideki Saito 2cde4cdb26 Drop OSX10.11 and FreeBSD12.4 from CI
- Fixes #476
- Fixes #486
- Drop OSX10.11 from ansible:2.9 and ansible-core:2.10
- Drop FreeBSD12.4 from ansible-core:devel

Signed-off-by: Hideki Saito <saito@fgrep.org>

test
2023-08-02 16:03:19 +09:00
softwarefactory-project-zuul[bot] 12a1c25f5e
Merge pull request #478 from maxamillion/test/rhel_updates
Update azure-pipelines for new RHEL versions

SUMMARY

Change to the CI system annnounced in the following required this change:
ansible-collections/news-for-maintainers#47
2023-07-06 22:34:53 +00:00
Adam Miller 7062be892e only for devel
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-07-06 10:19:58 -05:00
softwarefactory-project-zuul[bot] 20c2c30d23
Merge pull request #477 from saito-hideki/issue/476/1
Update CI tests to address changes on ansible-core

SUMMARY
Replace Python3.9 with 3.12 for ansible-test

Addresses issue #476

ISSUE TYPE

CI Test Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-07-04 01:39:12 +00:00
Hideki Saito 4f1e6b4a6d Drop Python3.9 and update versions of RHEL,Fedora and FreeBSD for ansible-core:devel
* Addresses issue #476
* Drop Python3.9
* Replace Fedora 37 with 38
* Replace FreeBSD13.1 with 13.2
* Replace RHEL 8.7 with 8.8
* Replace RHEL 9.1 with 9.2

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-07-04 09:15:24 +09:00
Adam Miller 806ab9ef9d Update azure-pipelines for new RHEL versions
Change to the CI system annnounced in the following required this
change:

  https://github.com/ansible-collections/news-for-maintainers/issues/47

Signed-off-by: Adam Miller <admiller@redhat.com>
2023-06-29 10:57:49 -05:00
softwarefactory-project-zuul[bot] 2ed8bdc8e8
Merge pull request #465 from felixfontein/req
Switch to Ansible Galaxy compatible requirements files for tests

SUMMARY
See ansible-community/community-topics#230.
ISSUE TYPE

Test Pull Request

COMPONENT NAME
test requirements files

Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
2023-05-31 14:01:42 +00:00
Felix Fontein 622aef2aad Switch to Ansible Galaxy compatible requirements files for tests. 2023-05-26 08:14:28 +02:00