Issue 1:
ISSUE TYPE

Feature Idea

COMPONENT NAME

gce module

gce_metadata module

ANSIBLE VERSION

ansible 2.5.0b1
config file = /work/ansible/git/ansible/ansible.cfg
configured module search path = [u'/home/ansible/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /work/ansible/virt-2.7/lib/python2.7/site-packages/ansible
executable location = /work/ansible/virt-2.7/bin/ansible
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

CONFIGURATION

ANSIBLE_PIPELINING(/work/ansible/git/ansible/ansible.cfg) = True

CACHE_PLUGIN(/work/ansible/git/ansible/ansible.cfg) = jsonfile

CACHE_PLUGIN_CONNECTION(/work/ansible/git/ansible/ansible.cfg) = /work/ansible/cache

CACHE_PLUGIN_TIMEOUT(/work/ansible/git/ansible/ansible.cfg) = 86400

DEFAULT_FORKS(/work/ansible/git/ansible/ansible.cfg) = 25

DEFAULT_GATHERING(/work/ansible/git/ansible/ansible.cfg) = smart

DEFAULT_REMOTE_USER(/work/ansible/git/ansible/ansible.cfg) = ansible

DEFAULT_ROLES_PATH(/work/ansible/git/ansible/ansible.cfg) = [u'/work/ansible/git/ansible/roles']

PERSISTENT_CONNECT_TIMEOUT(/work/ansible/git/ansible/ansible.cfg) = 30

RETRY_FILES_ENABLED(/work/ansible/git/ansible/ansible.cfg) = False

OS / ENVIRONMENT

LSB Version: :core-4.1-amd64:core-4.1-noarch

Distributor ID: CentOS

Description: CentOS Linux release 7.4.1708 (Core)

Release: 7.4.1708

Codename: Core

SUMMARY

There is currently no gce module to directly manage metadata within gce.

Metadata management is enabled within the gce module, but it cannot be changed or used except when creating an instance.

STEPS TO REPRODUCE

Utilize it as a simple module with fields for required information to interact with GCE and then another field with metadata, populated with the same hash/dictionary data as the gce module.

gce_metadata:
instance_name: example1
zone: us-central1-a
state: present
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
metadata : '{ "key1" : "value1","key2" : "value2", "key3" : "value3" }'

EXPECTED RESULTS

The expected results would be to set/confirm metadata fields provided within the module on a GCE instance.

ACTUAL RESULTS

Currently this is not something that can be done with ansible, if attempting to use the gce module you cannot just interact with metadata unless you configure all other options to match the current instance setup, which takes most possibilities of automation out of the use case.

Issue 2:
ISSUE TYPE

Feature Request

COMPONENT NAME

module: yum

ANSIBLE VERSION

ansible 2.3.2.0
config file = /ifs/ansible.cfg
configured module search path = [u'/opt/ansible/ansible_boot/.virtenv/ifs/lib/python2.7/site-packages/ansible/modules', u'/ifs/library']
python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]

CONFIGURATION

OS / ENVIRONMENT

RHEL7 & RHEL7

SUMMARY

When upgrading the packages, even if yum/dracut can't build the kernel initramfs due to too not enough space in /boot, the command completes successfully. This is revealed on reboot, as the kernel panics because no initramfs was built.

STEPS TO REPRODUCE

As long as the /boot partition is too small to build a new kernel initramfs for the newly installed kernel, yum will show dracut failing, ansible will not fail the task.

- hosts: all
tasks:

- name: (pre_event) Free space in /boot partition is greater than 40MB
shell: df -P /boot | grep -e "^/dev" | tr -s ' ' | cut -d ' ' -f 4
register: boot_partition_space
# 40MB
failed_when: boot_partition_space.stdout|int >= 40000

# Kernel has to be an update - else name=kernel
- name: (pre_event) Update all packages on the system
yum:
name: '*'
state: latest

EXPECTED RESULTS

The second task should fail when dracut fails to build the kernel initramfs

ACTUAL RESULTS

After the following script runs, and a reboot is issued, the server cannot boot up, as it always encounters a kernel panic.

Stdout:

[...]
Cleanup : ncurses-base-5.9-13.20130511.el7.noarch 1012/1013
Cleanup : libgcc-4.8.5-11.el7.x86_64 1013/1013
2661 blocks

gzip: stdout: No space left on device
dracut: creation of /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img failed
mkinitrd failed
warning: %posttrans(kernel-3.10.0-693.2.2.el7.x86_64) scriptlet failed, exit status 1
Uploading Package Profile
Verifying : zlib-1.2.7-17.el7.i686 1/1013
Verifying : yum-rhn-plugin-2.0.1-9.el7.noarch 2/1013
[...]

From our custom logging callback plugin:

"changed": true,
"msg": "Warning: RPMDB altered outside of yum.\n** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:\nkatello-ca-consumer-rhelsatsy01exdu.ent.oclc.org-1.0-12.noarch is a duplicate with katello-ca-consumer-rhelsatsy01exdu.ent.oclc.org-1.0-7.noarch\nNon-fatal POSTTRANS scriptlet failure in rpm package kernel-3.10.0-693.2.2.el7.x86_64\n",
"rc": 0,

So even though the return code is 0 for the yum command, - I would appreciate if the yum module would be able to catch this.