-
Notifications
You must be signed in to change notification settings - Fork 136
Don't fail without package manager #47
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
Conversation
Atomic Host uses unsupported package manager `rpm-ostree`. So, `ansible_pkg_mgr` is `unknown` and this task will fail. `sshd` is already in base system images. Apart from this, sshd configuration is standard for Fedora/CentOS. I'm not sure it's the right solution. May be it's better to create new boolean variable like `sshd_manage_install` and use it here in `when`.
|
Thanks for the PR.
Removing the check could have unintended consequences in other areas so I'd rather not do that.
If ansible_pkg_mgr is unknown this task should skip not fail. If this isn't the case please post the Ansible output and the output of ansible -m setup. If ansible_pkg_mgr is getting set to the wrong value (yum, maybe dnf?) that could cause a failure.
… On 22 Dec 2016, at 13:49, Sergey Korolev ***@***.***> wrote:
Atomic Host uses unsupported package manager rpm-ostree. So, ansible_pkg_mgr is unknown and this task will fail. sshd is already in base system images. Apart from this, sshd configuration is standard for Fedora/CentOS.
I'm not sure it's the right solution. May be it's better to create new boolean variable like sshd_manage_install and use it here in when.
You can view, comment on, or merge this pull request online at:
#47
Commit Summary
Don't fail without package manager
File Changes
M tasks/main.yml (1)
Patch Links:
https://github.com/willshersystems/ansible-sshd/pull/47.patch
https://github.com/willshersystems/ansible-sshd/pull/47.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Ansible output: ansible -m setup: |
|
Just to confirm, you're running the current version of the role from this repository, not your modified version? I'd expect to see this from your version as the when clause doesn't check for unknown pkg manager so will try to call a module called unknown. The one in this repo/galaxy should skip that task when pkg mgr is unknown. If this run is from the current role from galaxy there is a bug in the when logic, probably something to do with string matching.
… On 24 Dec 2016, at 17:26, Sergey Korolev ***@***.***> wrote:
Ansible output:
PLAY [zlt-10-200-128-net] ******************************************************
TASK [setup] *******************************************************************
Saturday 24 December 2016 20:19:36 +0300 (0:00:00.157) 0:00:00.157 *****
ok: [r0-m1-swarm1nd3.ng.av.loc]
PLAY [atomic] ******************************************************************
PLAY [all] *********************************************************************
TASK [mattwillsher.sshd : Set OS dependent variables] **************************
Saturday 24 December 2016 20:19:36 +0300 (0:00:00.709) 0:00:00.867 *****
ok: [r0-m1-swarm1nd3.ng.av.loc] => (item=/home/sk/dev/ro-ansible/galaxy_roles/mattwillsher.sshd/vars/Fedora.yml)
TASK [mattwillsher.sshd : OS is supported] *************************************
Saturday 24 December 2016 20:19:36 +0300 (0:00:00.027) 0:00:00.894 *****
ok: [r0-m1-swarm1nd3.ng.av.loc] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [mattwillsher.sshd : Installed] *******************************************
Saturday 24 December 2016 20:19:37 +0300 (0:00:00.023) 0:00:00.918 *****
fatal: [r0-m1-swarm1nd3.ng.av.loc]: FAILED! => {"failed": true, "msg": "The module unknown was not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run 'git submodule update --init --recursive' to correct this problem."}
to retry, use: --limit @tmp/site.retry
PLAY RECAP *********************************************************************
r0-m1-swarm1nd3.ng.av.loc : ok=3 changed=0 unreachable=0 failed=1
Saturday 24 December 2016 20:19:37 +0300 (0:00:00.024) 0:00:00.942 *****
===============================================================================
setup ------------------------------------------------------------------- 0.71s
mattwillsher.sshd : Set OS dependent variables -------------------------- 0.03s
mattwillsher.sshd : Installed ------------------------------------------- 0.02s
mattwillsher.sshd : OS is supported ------------------------------------- 0.02s
Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds
ansible -m setup:
r0-m1-swarm1nd3.ng.av.loc | SUCCESS => {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"10.200.128.40",
"172.17.0.1",
"172.18.0.1"
],
"ansible_all_ipv6_addresses": [
"fe80::250:56ff:fe99:3968",
"fe80::e87e:8eff:feaf:fc43",
"fe80::42:60ff:fe53:dcb5"
],
"ansible_architecture": "x86_64",
"ansible_bios_date": "09/21/2015",
"ansible_bios_version": "6.00",
"ansible_cmdline": {
"BOOT_IMAGE": "/ostree/fedora-atomic-e8537119b0ec3611d58c1493278560c4263de14af5853fab561cc2bfacd41b9c/vmlinuz-4.8.13-300.fc25.x86_64",
"ostree": "/ostree/boot.1/fedora-atomic/e8537119b0ec3611d58c1493278560c4263de14af5853fab561cc2bfacd41b9c/0",
"quiet": true,
"rd.lvm.lv": "fedora-atomic1/swap",
"rhgb": true,
"root": "/dev/mapper/fedora--atomic1-root"
},
"ansible_date_time": {
"date": "2016-12-24",
"day": "24",
"epoch": "1482600025",
"hour": "20",
"iso8601": "2016-12-24T17:20:25Z",
"iso8601_basic": "20161224T202025588323",
"iso8601_basic_short": "20161224T202025",
"iso8601_micro": "2016-12-24T17:20:25.588430Z",
"minute": "20",
"month": "12",
"second": "25",
"time": "20:20:25",
"tz": "MSK",
"tz_offset": "+0300",
"weekday": "Saturday",
"weekday_number": "6",
"weeknumber": "51",
"year": "2016"
},
"ansible_default_ipv4": {
"address": "10.200.128.40",
"alias": "ens192",
"broadcast": "10.200.131.255",
"gateway": "10.200.128.1",
"interface": "ens192",
"macaddress": "00:50:56:99:39:68",
"mtu": 1500,
"netmask": "255.255.252.0",
"network": "10.200.128.0",
"type": "ether"
},
"ansible_default_ipv6": {},
"ansible_devices": {
"sda": {
"holders": [],
"host": "Serial Attached SCSI controller: VMware PVSCSI SCSI Controller (rev 02)",
"model": "Virtual disk",
"partitions": {
"sda1": {
"holders": [],
"sectors": "614400",
"sectorsize": 512,
"size": "300.00 MB",
"start": "2048",
"uuid": "307b55e7-8fb0-420a-85a4-33e747e43d81"
},
"sda2": {
"holders": [
"fedora--atomic1-swap",
"fedora--atomic1-docker--pool_tmeta",
"fedora--atomic1-root",
"fedora--atomic1-docker--pool_tdata"
],
"sectors": "32937984",
"sectorsize": 512,
"size": "15.71 GB",
"start": "616448",
"uuid": null
}
},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "cfq",
"sectors": "33554432",
"sectorsize": "512",
"size": "16.00 GB",
"support_discard": "0",
"vendor": "VMware"
}
},
"ansible_distribution": "Fedora",
"ansible_distribution_major_version": "25",
"ansible_distribution_release": "Twenty Five",
"ansible_distribution_version": "25",
"ansible_dns": {
"nameservers": [
"127.0.0.53"
]
},
"ansible_docker0": {
"active": false,
"device": "docker0",
"features": {},
"id": "8000.0242db9e552e",
"interfaces": [],
"ipv4": {
"address": "172.17.0.1",
"broadcast": "global",
"netmask": "255.255.0.0",
"network": "172.17.0.0"
},
"macaddress": "02:42:db:9e:55:2e",
"mtu": 1500,
"promisc": false,
"stp": false,
"type": "bridge"
},
"ansible_domain": "",
"ansible_ens192": {
"active": true,
"device": "ens192",
"features": {},
"ipv4": {
"address": "10.200.128.40",
"broadcast": "10.200.131.255",
"netmask": "255.255.252.0",
"network": "10.200.128.0"
},
"ipv6": [
{
"address": "fe80::250:56ff:fe99:3968",
"prefix": "64",
"scope": "link"
}
],
"macaddress": "00:50:56:99:39:68",
"module": "vmxnet3",
"mtu": 1500,
"pciid": "0000:0b:00.0",
"promisc": false,
"speed": 10000,
"type": "ether"
},
"ansible_env": {
"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/0/bus",
"HOME": "/root",
"LANG": "C",
"LC_ALL": "C",
"LC_MESSAGES": "C",
"LESSOPEN": "||/usr/bin/lesspipe.sh %s",
"LOGNAME": "root",
"MAIL": "/var/mail/root",
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin",
"PWD": "/var/roothome",
"SELINUX_LEVEL_REQUESTED": "",
"SELINUX_ROLE_REQUESTED": "",
"SELINUX_USE_CURRENT_RANGE": "",
"SHELL": "/bin/bash",
"SHLVL": "2",
"SSH_AUTH_SOCK": "/tmp/ssh-sDR2vpgxV0/agent.7057",
"SSH_CLIENT": "10.200.8.3 33520 22",
"SSH_CONNECTION": "10.200.8.3 33520 10.200.128.40 22",
"USER": "root",
"XDG_RUNTIME_DIR": "/run/user/0",
"XDG_SESSION_ID": "9",
"_": "/usr/bin/python"
},
"ansible_fips": false,
"ansible_form_factor": "Other",
"ansible_fqdn": "r0-m1-swarm1nd3",
"ansible_gather_subset": [
"hardware",
"network",
"virtual"
],
"ansible_hostname": "r0-m1-swarm1nd3",
"ansible_interfaces": [
"lo",
"ens192",
"docker0",
"docker_gwbridge",
"vethd0b38c2"
],
"ansible_kernel": "4.8.13-300.fc25.x86_64",
"ansible_lo": {
"active": true,
"device": "lo",
"features": {},
"ipv4": {
"address": "127.0.0.1",
"broadcast": "host",
"netmask": "255.0.0.0",
"network": "127.0.0.0"
},
"ipv6": [
{
"address": "::1",
"prefix": "128",
"scope": "host"
}
],
"mtu": 65536,
"promisc": false,
"type": "loopback"
},
"ansible_lvm": {
"lvs": {
"docker-pool": {
"size_g": "4.43",
"vg": "fedora-atomic1"
},
"root": {
"size_g": "3.00",
"vg": "fedora-atomic1"
},
"swap": {
"size_g": "1.60",
"vg": "fedora-atomic1"
}
},
"vgs": {
"fedora-atomic1": {
"free_g": "6.63",
"num_lvs": "3",
"num_pvs": "1",
"size_g": "15.70"
}
}
},
"ansible_machine": "x86_64",
"ansible_machine_id": "209de4333ce6478eb9cc8d7cf369632c",
"ansible_memfree_mb": 1274,
"ansible_memory_mb": {
"nocache": {
"free": 1719,
"used": 281
},
"real": {
"free": 1274,
"total": 2000,
"used": 726
},
"swap": {
"cached": 0,
"free": 1639,
"total": 1639,
"used": 0
}
},
"ansible_memtotal_mb": 2000,
"ansible_mounts": [
{
"device": "/dev/mapper/fedora--atomic1-root",
"fstype": "ext4",
"mount": "/sysroot",
"options": "rw,seclabel,relatime,data=ordered",
"size_available": 828141568,
"size_total": 3103539200,
"uuid": "0336047a-9f85-4b86-b7eb-c92e5f027c51"
},
{
"device": "/dev/mapper/fedora--atomic1-root",
"fstype": "ext4",
"mount": "/",
"options": "rw,seclabel,relatime,data=ordered,bind",
"size_available": 828141568,
"size_total": 3103539200,
"uuid": "0336047a-9f85-4b86-b7eb-c92e5f027c51"
},
{
"device": "/dev/mapper/fedora--atomic1-root",
"fstype": "ext4",
"mount": "/var",
"options": "rw,seclabel,relatime,data=ordered,bind",
"size_available": 828141568,
"size_total": 3103539200,
"uuid": "0336047a-9f85-4b86-b7eb-c92e5f027c51"
},
{
"device": "/dev/mapper/fedora--atomic1-root",
"fstype": "ext4",
"mount": "/usr",
"options": "ro,seclabel,relatime,data=ordered,bind",
"size_available": 828141568,
"size_total": 3103539200,
"uuid": "0336047a-9f85-4b86-b7eb-c92e5f027c51"
},
{
"device": "/dev/sda1",
"fstype": "ext4",
"mount": "/boot",
"options": "rw,seclabel,relatime,data=ordered",
"size_available": 193838080,
"size_total": 296227840,
"uuid": "307b55e7-8fb0-420a-85a4-33e747e43d81"
},
{
"device": "/dev/mapper/fedora--atomic1-root",
"fstype": "ext4",
"mount": "/var/lib/docker/devicemapper",
"options": "rw,seclabel,relatime,data=ordered,bind",
"size_available": 828141568,
"size_total": 3103539200,
"uuid": "0336047a-9f85-4b86-b7eb-c92e5f027c51"
}
],
"ansible_nodename": "r0-m1-swarm1nd3.ng.av.loc",
"ansible_os_family": "RedHat",
"ansible_pkg_mgr": "unknown",
"ansible_processor": [
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5530 @ 2.40GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 1,
"ansible_product_name": "VMware Virtual Platform",
"ansible_product_serial": "VMware-42 19 ca fc 5b a4 a1 df-5b 56 bf 7a 83 c5 0f 55",
"ansible_product_uuid": "4219CAFC-5BA4-A1DF-5B56-BF7A83C50F55",
"ansible_product_version": "None",
"ansible_python": {
"executable": "/usr/bin/python",
"has_sslcontext": true,
"type": "CPython",
"version": {
"major": 2,
"micro": 12,
"minor": 7,
"releaselevel": "final",
"serial": 0
},
"version_info": [
2,
7,
12,
"final",
0
]
},
"ansible_python_version": "2.7.12",
"ansible_selinux": {
"config_mode": "enforcing",
"mode": "enforcing",
"policyvers": 30,
"status": "enabled",
"type": "targeted"
},
"ansible_service_mgr": "systemd",
"ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK7Rm8gaXrMV7OqUOBDDM2Egd6pio3NdDjLDEOf3dZLZsaZ9IE9ALGGCByvgu4RG0CA19gmiSVDXZez5ZrVynZw=",
"ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAINgKM2KKT115tnpywfOq6tlu4Ux+mfOPG+SwRGZzgYGL",
"ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCs1rBFFMO3LVYpJtY+LuLhU2xMRX4O8HlXfHzPMmskPFC+aSVaiIp144+o7qQAnHOWAKFu2y23s4EH+y0TYJfz5q6novliM9GldYp6q3XX/jKWCfg31p1xB2SjvD4wGBNEksFOnocrWbuTugNHzBZlt91mCkAFBd7gEpn6M8tm8q6PfR7blhAgJKHckZ4q/FmouBmyu6Ww424PLxuw7ttcDI2HMriSSq7hvgevpeKD98Cqys4NXLk0ChCqLcIvNuAP+1Bziq6kbVbzGZjydPY+gXluLiGEh9VVOpc4K1VXrIJcaGoh+OGa9xCp5KjUtpB+Nu5x1zCxqE9sYwizvzyH",
"ansible_swapfree_mb": 1639,
"ansible_swaptotal_mb": 1639,
"ansible_system": "Linux",
"ansible_system_capabilities": [
"cap_chown",
"cap_dac_override",
"cap_dac_read_search",
"cap_fowner",
"cap_fsetid",
"cap_kill",
"cap_setgid",
"cap_setuid",
"cap_setpcap",
"cap_linux_immutable",
"cap_net_bind_service",
"cap_net_broadcast",
"cap_net_admin",
"cap_net_raw",
"cap_ipc_lock",
"cap_ipc_owner",
"cap_sys_module",
"cap_sys_rawio",
"cap_sys_chroot",
"cap_sys_ptrace",
"cap_sys_pacct",
"cap_sys_admin",
"cap_sys_boot",
"cap_sys_nice",
"cap_sys_resource",
"cap_sys_time",
"cap_sys_tty_config",
"cap_mknod",
"cap_lease",
"cap_audit_write",
"cap_audit_control",
"cap_setfcap",
"cap_mac_override",
"cap_mac_admin",
"cap_syslog",
"cap_wake_alarm",
"cap_block_suspend",
"cap_audit_read+ep"
],
"ansible_system_capabilities_enforced": "True",
"ansible_system_vendor": "VMware, Inc.",
"ansible_uptime_seconds": 95391,
"ansible_user_dir": "/root",
"ansible_user_gecos": "root",
"ansible_user_gid": 0,
"ansible_user_id": "root",
"ansible_user_shell": "/bin/bash",
"ansible_user_uid": 0,
"ansible_userspace_architecture": "x86_64",
"ansible_userspace_bits": "64",
"ansible_vethd0b38c2": {
"active": true,
"device": "vethd0b38c2",
"features": {},
"ipv6": [
{
"address": "fe80::e87e:8eff:feaf:fc43",
"prefix": "64",
"scope": "link"
}
],
"macaddress": "ea:7e:8e:af:fc:43",
"mtu": 1500,
"promisc": true,
"speed": 10000,
"type": "ether"
},
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",
"module_setup": true
},
"changed": false
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
I'm a little confused. |
|
The festive season has done something to my brain. Sorry for my confusion, I see your commit was adding the line, not removing it! |
Atomic Host uses unsupported package manager
rpm-ostree. So,ansible_pkg_mgrisunknownand this task will fail.sshdis already in base system images. Apart from this, sshd configuration is standard for Fedora/CentOS.I'm not sure it's the right solution. May be it's better to create new boolean variable like
sshd_manage_installand use it here inwhen.