I am trying to update the CentOS systems with ansible. Unfortunately I am not able to do that.
I already tried:
- name: install updates
yum: update_cache=yes
when: ansible_os_family == "RedHat
Isn't working.
- name: install updates
yum: name=* state=latest
when: ansible_os_family == "RedHat
The last task works but is it true, that the task updates the system?
The first task you're telling the system to only update the yum cache.
On the second you are effectively upgrading all packages to the latest version by using state=latest but you should also use update_cache=yes on the same task to be sure you're refreshing the cache with its latest package information.
The yum module documentation provides exactly this example:
- name: upgrade all packages
yum: name=* state=latest
After the execution of the task, the terminal should display a message in yellow meaning the status of the task is changed.
Related
I would like to configure CI in Appveyor for a .net project and I am struggling with following errors:
error NU1403: Package content hash validation failed for System.Collections.NonGeneric.4.3.0. The package is different than the last restore.
Every project restore happens to throw similar thing
There was similar question and one advice was to clear nuget cache.
Whats the best course of action here?
Thanks
Directory.Build.props
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
Build started
git config --global core.autocrlf true
git clone -q --branch=master https://github.com/User/App.git C:\projects\App
git checkout -qf 7066b969dd7564c573fb5e30fa6600a86c48644f
choco install opencover.portable
Chocolatey v0.11.3
Installing the following packages:
opencover.portable
By installing, you accept licenses for the packages.
Progress: Downloading opencover.portable 4.7.1221... 100%
opencover.portable v4.7.1221 [Approved]
opencover.portable package files install completed. Performing other installation steps.
Downloading opencover.portable
from 'https://github.com/OpenCover/opencover/releases/download/4.7.1221/opencover.4.7.1221.zip'
Progress: 100% - Completed download of C:\Users\appveyor\AppData\Local\Temp\1\chocolatey\opencover.portable\4.7.1221\opencover.4.7.1221.zip (7.76 MB).
Download of opencover.4.7.1221.zip (7.76 MB) completed.
Hashes match.
Extracting C:\Users\appveyor\AppData\Local\Temp\1\chocolatey\opencover.portable\4.7.1221\opencover.4.7.1221.zip to C:\ProgramData\chocolatey\lib\opencover.portable\tools...
C:\ProgramData\chocolatey\lib\opencover.portable\tools
ShimGen has successfully created a shim for OpenCover.Console.exe
ShimGen has successfully created a shim for OpenCover.Simple.Target.exe
ShimGen has successfully created a shim for OpenCover.Simple.Target.exe
The install of opencover.portable was successful.
Software installed to 'C:\ProgramData\chocolatey\lib\opencover.portable\tools'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Did you know the proceeds of Pro (and some proceeds from other
licensed editions) go into bettering the community infrastructure?
Your support ensures an active community, keeps Chocolatey tip-top,
plus it nets you some awesome features!
https://chocolatey.org/compare
choco install codecov
Chocolatey v0.11.3
Installing the following packages:
codecov
By installing, you accept licenses for the packages.
Progress: Downloading codecov 1.13.0... 100%
codecov v1.13.0 [Approved]
codecov package files install completed. Performing other installation steps.
Extracting 64-bit C:\ProgramData\chocolatey\lib\codecov\tools/codecov-win7-x64.zip to C:\ProgramData\chocolatey\lib\codecov\tools...
C:\ProgramData\chocolatey\lib\codecov\tools
ShimGen has successfully created a shim for codecov.exe
The install of codecov was successful.
Software installed to 'C:\ProgramData\chocolatey\lib\codecov\tools'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
dotnet --version
5.0.403
dotnet restore
Determining projects to restore...
C:\projects\App\Tests\Common.Tests\Common.Tests.csproj : error NU1403: Package content hash validation failed for System.Collections.NonGeneric.4.3.0. The package is different than the last restore. [C:\projects\App\App.sln]
appveyor.xml
version: '1.0.{build}'
image: Visual Studio 2019
branches:
only:
- master
init:
- cmd: git config --global core.autocrlf true
install:
before_build:
- choco install opencover.portable
- choco install codecov
- cmd: dotnet --version
- cmd: dotnet restore
build_script:
- cmd: dotnet build --configuration Release --no-restore
test_script:
- cmd: dotnet test --configuration Release --no-build --no-restore --verbosity minimal --test-adapter-path:. --logger:Appveyor /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:MergeWith="../TestResults/coverage.json" /p:CoverletOutputFormat=lcov
cache:
- '%USERPROFILE%\.nuget\packages -> **\project.json'
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
deploy: off
At Feodor suggestion I added powershell script which removes package.lock.json files and it worked.
before_build:
- choco install opencover.portable
- choco install codecov
- ps: >-
Get-ChildItem .\ -include packages.lock.json -Recurse | foreach ($_) { remove-item $_.fullname -Force }
- cmd: dotnet --version
- cmd: dotnet restore
I was running a self hosted github action runner but my jobs were failing with this error message in the picture. I searched stackoverflow before posting the question but couldn't find any relevant threads. Let me know if there are threads that I missed.
How do I resolve this error so that my github action runner can run my CI builds again?
The built-in GitHub Action runners have yarn installed on them by default but a self-hosted runner won't unless you install it. See relevant issue here: https://github.com/actions/setup-node/issues/182.
If you don't want to install yarn on your self-hosted runner you can install it in the workflows that need it. Just make sure to uninstall it afterward to keep your self-hosted runners clean.
# You'll need to make sure node is installed first
- name: Install Node
uses: actions/setup-node#v3
with:
node-version-file: '.node-version'
- name: Install yarn
run: npm install -g yarn
# Do what you need to do with yarn
# Uninstall when you're done
- name: Clean up
if: always()
run: npm uninstall -g yarn
I realised that the issue was literally as described in the error that for some reason yarn was not found on my computer. This was a little strange as I remembered installing yarn before.
Nevertheless I ran
brew install yarn
And ran brew update and upgrade just in case my homebrew was outdated
brew update
brew upgrade
And it resolved the error and issues.
We're using Elastic Beanstalk, (Postgres, Node.js running on 64bit Amazon Linux/3.2.0) and I woke up today to a Severe Health warning, causing all requests to respond with a 502 Bad Gateway. I haven't manually deployed since 4/9/19, so not sure why this happened all of a sudden.
The original error we got was:
Application deployment failed at 2019-04-18T15:39:51Z with exit status 1 and error: Package listed in EBExtension failed to install.
Yum does not have postgresql96-devel available for installation.
The repo I inherited is a little untidy, and I found instance of postgres96-devel in three different files:
.ebextensions/config.yml
.ebextensions/proxy.config
proxy.config
My config.yml file looks like:
packages:
rpm:
postgresql: https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm
yum:
postgresql96-devel: []
perl-CPAN: []
I noticed the rpm link returns a 404, and when looking for a better url, I saw this warning on the Postgres RPM page:
As of 15 April 2019, there is only one repository RPM per distro, and
it includes repository information for all available PostgreSQL
releases
What I've tried:
Redeploying the last successful build from 4/9/19
Changing the config.yml file to look like
// obviously I'm thrashing here
packages:
rpm:
postgresql: https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum:
postgresql11-devel: []
perl-CPAN: []
According to this AWS support article, I terminated the instance and let EB bring up a new instance.
With all these trials + redeploying, I still seeing errors like:
Application deployment failed at 2019-04-18T17:40:41Z with exit status 1 and error: Package listed in EBExtension failed to install.
Yum does not have postgresql96-devel available for installation.
Incorrect application version "app-v1_4_1-190418_084747" (deployment
98). Expected version "app-v1_4_1-190409_140626" (deployment 104).
Process default has been unhealthy for 42 minutes
(Target.FailedHealthChecks).
I'm not sure why it's complaining about postgres96-devel since I changed my config file to point to postgres11-devel.
Any ideas how to get things back up and running?
I was able to get everything back up and running. Here's what I think happened.
Our prod instances were running Linux 3.2. This did not contain the correct rpm package, so it relied on the rpm link from config.yml.
That url broke as of 4/15/19, so when EB went to deploy and pull that RPM, it failed, causing the entire deployment to fail.
The fix was to simply downgrade the yum package from postresql96-devel to postgres95-devel. Linux 3.2's yum directory contained postgres95-devel, so the deployment was able to skip going out to the internet to download the rpm (which at this point was broken).
You can install the PostgreSQL 9.6 using the amazon-linux-extra tool:
(if using docker, in a Dockerfile: )
RUN amazon-linux-extras install postgresql9.6
I have been trying to install a package that exists in alpine aports
and specifically that one but I cannot find how. Is it even possible? If yes, how?
The package filebeat you defined in the question is located in edge branch of testing repository. There is no such repo in alpine container by default.
In order to install a filebeat package on the alpine platform we need:
1. Add testing repo:
/ # echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
2. Install the filebeat package:
/ # apk add --no-cache filebeat
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
WARNING: This apk-tools is OLD! Some packages might not function properly.
(1/1) Installing filebeat (5.6.3-r0)
Executing busybox-1.27.2-r7.trigger
OK: 20 MiB in 12 packages
Is it possible to specify the minor version of the JDK for jobs running on Travis? I have a JavaFX project which is failing because JDK 1.8.0_31 is being used to perform the build where as the project uses some classes that were only shipped in Java 1.8.0_40 (specifically Alert and Spinner).
Currently my .travis.yml file looks like below:
language: java
jdk:
- oraclejdk8
Here's a link to the failed build just in case it's useful.
This solution based on apt addon works for me:
language: java
jdk:
- oraclejdk8
addons:
apt:
packages:
- oracle-java8-installer
In result I have java version "1.8.0_91". The solution source is here
I finally got it working. This solution is not really reccommended as it uses linuxbrew to install Oracle JDK 8.0_40. Thanks to zrcoder on Github I ended up with this .travis.yml:
language: java
branches:
only:
- master
notifications:
email: false
before_install:
- rm -rf ~/.linuxbrew
- yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
- export PATH="$HOME/.linuxbrew/bin:$PATH"
- export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
- export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
- brew install jdk
- export JAVA_HOME=/home/travis/.linuxbrew/Cellar/jdk/1.8.0-40
Although this works, Travis-CI should be updated by next month, so update your config for shorter build times.
I recommend using Travis CI's Trusty build environment which uses newer software than the default Precise environment. It's quicker and more reliable than redownloading the newest JDK on each build.
Just add the following to the top level of .travis.yml
dist: trusty