Hello,
I’ve been struggling with outputting yum update results in a nice way. So I start with installing some required packages and registering the output in yum_install_required_output:
`
- name: “Install multiple required packages to get started”
yum:
name: - deltarpm
- yum-utils
- zsh
- git
- openssh
- openssh-server
register: yum_install_required_output
`
Then I try to output the yum_install_required_output registered result without the \n’s:
`
- debug:
msg: “ITEM {{item.split(‘\n’)}}”
with_items: “{{yum_install_required_output.results}}”
ignore_errors: true
`
So as openssh and openssh-server are already installed (on this particular server), I get a list like this:
`
ok: [172.104.136.100] => (item=openssh-7.4p1-13.el7_4.x86_64 providing openssh is already installed) => {
“changed”: false,
“item”: “openssh-7.4p1-13.el7_4.x86_64 providing openssh is already installed”,
“msg”: “ITEM [u’openssh-7.4p1-13.el7_4.x86_64 providing openssh is already installed’]”
}
ok: [172.104.136.100] => (item=openssh-server-7.4p1-13.el7_4.x86_64 providing openssh-server is already installed) => {
“changed”: false,
“item”: “openssh-server-7.4p1-13.el7_4.x86_64 providing openssh-server is already installed”,
“msg”: “ITEM [u’openssh-server-7.4p1-13.el7_4.x86_64 providing openssh-server is already installed’]”
}
ok: [172.104.136.100] => (item=Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
- base: mirrors.linode.com
- epel: mirror.23media.de
- extras: mirrors.linode.com
- updates: mirrors.linode.com
Resolving Dependencies
→ Running transaction check
—> Package deltarpm.x86_64 0:3.6-3.el7 will be installed
—> Package git.x86_64 0:1.8.3.1-12.el7_4 will be installed
→ Processing Dependency: perl-Git = 1.8.3.1-12.el7_4 for package: git-1.8.3.1-12.el7_4.x86_64
→ Processing Dependency: rsync for package: git-1.8.3.1-12.el7_4.x86_64
→ Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-12.el7_4.x86_64
→ Processing Dependency: perl(Git) for package: git-1.8.3.1-12.el7_4.x86_64
→ Processing Dependency: perl(Error) for package: git-1.8.3.1-12.el7_4.x86_64
→ Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-12.el7_4.x86_64
—> Package yum-utils.noarch 0:1.1.31-42.el7 will be installed
→ Processing Dependency: python-kitchen for package: yum-utils-1.1.31-42.el7.noarch
→ Processing Dependency: libxml2-python for package: yum-utils-1.1.31-42.el7.noarch
—> Package zsh.x86_64 0:5.0.2-28.el7 will be installed
→ Running transaction check
—> Package libgnome-keyring.x86_64 0:3.12.0-1.el7 will be installed
—> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed
—> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
—> Package perl-Git.noarch 0:1.8.3.1-12.el7_4 will be installed
—> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
—> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
→ Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
—> Package rsync.x86_64 0:3.0.9-18.el7 will be installed
→ Running transaction check
—> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed
→ Finished Dependency Resolution
Dependencies Resolved