Resolving Chef Cookbook Dependencies - automation

I'm following a basic chef tutorial outlined here, which walks you through creating an initial chef-repo with various cookbooks from the supermarket.
I'm at the point where I have a hosted chef account set up and I need to upload all my local cookbooks to my hosted chef server.
So I run this locally -
> knife cookbook upload --all
Uploading apache2 [3.0.1]
Uploading apt [2.7.0]
Uploading aws [2.7.0]
Uploading build-essential [2.1.2]
Uploading chef-sugar [3.1.0]
Uploading chef_handler [1.1.8]
Uploading database [4.0.6]
Uploading homebrew [1.12.0]
Uploading iis [4.1.1]
Uploading iptables [1.0.0]
Uploading logrotate [1.9.1]
Uploading mariadb [0.3.0]
Uploading mysql [4.1.2]
ERROR: Cookbook mysql depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'build-essential' version '~> 1.4'
Ok, so mysql cookbook is complaining that it needs build-essential, ~> 1.4. No problem, let me just get that specific version...
> knife cookbook site download build-essential 1.4.4
Great, now I have the right build-essential version. Let's try it again..
> knife cookbook upload --all
Uploading apache2 [3.0.1]
Uploading apt [2.7.0]
Uploading aws [2.7.0]
Uploading build-essential [1.4.4]
Uploading chef-sugar [3.1.0]
Uploading chef_handler [1.1.8]
Uploading database [4.0.6]
Uploading homebrew [1.12.0]
ERROR: Cookbook homebrew depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'build-essential' version '>= 2.1.2'
Well now it breaks homebrew, which complains it needs build-essenitial, >= 2.12.
How do I get out of this dependency cycle? I can't have two different versions of the same cookbook, can I? I downloaded this straight from the tutorial's site - am I stuck just trying to figure out the right version of all these things?
Thanks!

Your mysql cookbook version is old and therefore has old dependencies. Try to upgrade it to the latest release. And also use the new version of build-essenitial.
See https://supermarket.chef.io/cookbooks/mysql

Related

Install Zenko Cloud Server on ubuntu 20.04 for development purpose

For a couple of days, I have been trying to install the Zenko cloud server for development purposes on my ubuntu 20.04 machine. I am new to Docker and definitely not very much comfortable with Kubernetes and Helm. I am trying to follow this instruction. During the installation stage when I am trying to follow this link, I am getting this error
Error: validation failed: [unable to recognize "": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1", unable to recognize "": no matches for kind "PodDisruptionBudget" in version "policy/v1beta1", unable to recognize "": no matches for kind "CronJob" in version "batch/v1beta1"]
while executing this command.
helm install
https://github.com/scality/Zenko/releases/download/1.2.5/zenko-1.2.5.tgz
I have also tried this link to install Zenko. I have successfully cloned Zenko from the git repository.
git clone https://github.com/scality/Zenko.git
But while executing cd ./zenko/charts, I am getting this error.
bash: cd: ./zenko/charts: No such file or directory
I have installed Minkube by following this link and also installed Helm2 by following this link. Also, I have tried to follow this Zenko documentation but did not quite understand it.
My current goal is to install the Zenko cloud server and upload files to Amazon S3 and also to my local directory where both can be managed via Zenko according to their documentation.
It will be very helpful if someone shows me some way to solve this issue. Thanks in advance.

How install memcached in Mac Bigsur with PHP 7.3 and home brew

I am working on a project with setup PHP7.3, Drupal 6.4 with memcached. Memcached is working in server and in my local machine with windows. But I am not able to make it work in my Mac machine. I followed the below link to make this work.
https://www.journaldev.com/1/install-memcached-mac
And I tried
brew install memcached
Also.
Then added
[memcached]
extension="memcached.so"
In php.ini file. Then restarted apache. After this on the first run I got the error
{"Error Details":{"Message":"\n Error code : 32\n Message : PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /usr/local/lib/php/pecl/20180731/memcached.so (dlopen(/usr/local/lib/php/pecl/20180731/memcached.so, 9): image not found), /usr/local/lib/php/pecl/20180731/memcached.so.so (dlopen(/usr/local/lib/php/pecl/20180731/memcached.so.so, 9): image not found))\n File name : Unknown\n Line no : 0\n Date :12-March-21 02:45:05\n Path : http://localhost/mysite/?q="}}
But from the second run onwards the error is not there. But memcache is not working. And I can't find the memcached.so file in my system.
How can I fix this? Please help
I tried this. It helps.
https://izziswift.com/how-to-install-memcached-module-for-php7-1-on-macos-high-sierra/
pecl bundle memcached
Change to the directory it output.
phpize
Make sure libmemcached and zlib are installed (brew install libmemcached zlib).
Get the zlib directory (brew list zlib).
./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/ (replace the zlib path with the one from the previous command).
make
make install
Add the extension line in your php.ini file (ex. change the paths to match what make install output. I added this to my /usr/local/etc/php/7.4/conf.d directory in a file called ext-memcached.ini.
[memcached]
extension=memcached.so
Verify you installed the module php -m should show you memcached in the outputted list.
Have you remembered to start the service?
brew services start memcached

Yum install graphviz on RHEL 7 fails with 'No package graphviz available.'

I am trying to install graphviz on my RHEL VM. when I run
$sudo yum install graphviz
I get this:
This system is not registered with an entitlement server. You can use subscription-manager to register.
No package graphviz available.
Error: Nothing to do
I later found out that I get this same problem with all packages.
I have tried several solutions I have found online such as:
saving the .repo file found here (this link will download the file)
then running
#from dir containing graphviz-rhel.repo
$sudo yum-config-manager --add-repo graphviz-rhel.repo
the output was
This system is not registered with an entitlement server. You can use subscription-manager to register.
adding repo from: graphviz-rhel.repo
grabbing file graphviz-rhel.repo to /etc/yum.repos.d/graphviz-rhel.repo
repo saved to /etc/yum.repos.d/graphviz-rhel.repo
Then I ran
$sudo yum-config-manager --enable graphviz-rhel
This gives no output and $yum-config-manager list all does not list anything related to graphviz as a repo (enabled or disabled)
I tried the solution here: failed to install 'graphviz*' packages with yum command on my RHEL server
except I found the rpm file here
When I ran the rpm command I got an error because I was missing a couple dozen dependencies so I dont think following this solution for all of them is a reasonable solution.
If someone can either inform me why one of these didn't work or let me know how to accomplish my goal of getting yum install <package> to work I would greatly appreciate it.
As posted in the comments, in order to utilize yum on a RHEL system you need an active subscription

What is phantomjs --wd command alternative for slimerjs?

I was using Phantomjs with Phoenix framework for test, and the package I use in phoenix is hound.
I previously installed phantomjs with apt-get which was giving problems (this github comment said the installation method was the culprit), so I downloaded the latest binary from the official website but that was giving permissions denied error, so I had to build it from the source, but to my surprise the build.py which is mentioned in the official guide wasn't avaialble, so I even failed to build it that way.
I also failed to install through npm, so I gave up on phantomjs.
Now I installed slimerjs, but I don't know what is slimerjs's alternative command to phantomjs --wd.

Duplicity, amazon s3 backend exception

I'm trying to create an auto backup using duplicity into amazon s3 following this guide: easy server backups to amazon s3 with duplicity
However, at this command:
duplicity /var/www s3+http://com.mycorp.myhost.backup
I encounter the error:
BackendException: Could not initialize backend: No module named boot
Googling does not yield understandable results for me. FYI, the actual command I run is:
duplicity /Users/okyretina/Dropbox/archive/ s3+http://com.sinkdrive.okyretina.dropbox.archieve
I understand that this guide is for linux and I am using mac osx lion but I figured it should work as well. Any help is appreciated. Thanks.
If you are on debian/ubuntu you can install it via: sudo apt-get install python-boto
I was getting the same problem again when upgrading to Ubuntu 19.10 and installing python-boto was not helping. Turns out python3-boto is required in newer versions.
sudo apt install python3-boto
It turns out that I need to install boto first from here