Geekflare est soutenu par notre public. Nous pouvons gagner des commissions d'affiliation en achetant des liens sur ce site.
Partager sur:

Comment installer Chef sur Ubuntu 18?

chef ubuntu
Scanner de sécurité des applications Web Invicti – la seule solution qui offre une vérification automatique des vulnérabilités avec Proof-Based Scanning™.

Apprenez à installer Chef sur Ubuntu…

Chef est un outil de gestion de configuration basé sur ruby. Il est utilisé pour automatiser la gestion des configurations sur tous les nœuds du cluster et maintenir la cohérence. Il y a trois composants principaux de Chef.

  • Serveur de chef
  • Poste de travail
  • Nodes

Toutes les configurations sont gérées depuis les postes de travail et ensuite poussées vers le chef-serveur. Le serveur Chef est le magasin centralisé de toutes les configurations d'infrastructure. Knife est un outil de ligne de commande présent sur un poste de travail utilisé pour interagir avec Chef Server. Les nœuds exécutent des clients chef qui demandent des informations de configuration au serveur chef.

Voici à quoi ressemble une architecture Chef typique:

architecture de chef

Passons maintenant à la configuration de chef Server, Workstation et Node (Chef Client).

Environment Details

J'utilise 3 systèmes Ubuntu 18.04. L'un agira en tant que serveur chef, et le suivant sera un poste de travail, et un 3e système sera le nœud.

Serveur Chef

  • Nom d'hôte: chef-geekflare
  • Adresse IP: 192.168.0.107

Poste de travail

  • Nom d'hôte: poste de travail
  • Adresse IP: 192.168.0.108

Nœud

  • Nom d'hôte: client-nœud
  • Adresse IP: 192.168.0.109

Avant de commencer l'installation, je dois modifier le / Etc / hosts fichier de tous les systèmes afin qu'ils puissent se résoudre les uns les autres. Modifier le /etc/hosts fichier sur tous les systèmes, comme indiqué ci-dessous.

geekflare@chef-geekflare:~$ 
127.0.0.1 localhost 
127.0.1.1 geekflare 
192.168.0.107 chef-geekflare 
192.168.0.108 chef-workstation 
192.168.0.109 client-node

Je vais exécuter la commande ci-dessous sur les trois systèmes pour les mettre à jour.

geekflare@chef-geekflare:~$ sudo apt update

[sudo] password for geekflare:

Hit:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease

Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]     

Hit:3 http://ppa.launchpad.net/ansible/ansible/ubuntu cosmic InRelease        

Hit:4 http://us.archive.ubuntu.com/ubuntu cosmic InRelease                    

Get:5 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [9,594 B]

Hit:6 http://us.archive.ubuntu.com/ubuntu cosmic-updates InRelease            

Hit:7 http://us.archive.ubuntu.com/ubuntu cosmic-backports InRelease          

Get:8 http://apt.puppetlabs.com bionic InRelease [85.3 kB]                    

Get:9 http://apt.puppetlabs.com bionic/puppet6 amd64 Packages [32.4 kB]

Fetched 192 kB in 2s (84.6 kB/s)   

Reading package lists... Done

Building dependency tree      

Reading state information... Done

233 packages can be upgraded. Run 'apt list --upgradable' to see them.

Chef Server Installation

Chef Server est un composant de l'architecture qui connecte Workstation et Nodes. Lorsque les configurations sont éditées / modifiées sur un poste de travail, elles sont transmises au serveur chef, et tous les nœuds extraient ces modifications de configuration du serveur Chef.

Maintenant, exécutons la commande ci-dessous pour télécharger le package chef-server.

geekflare@chef-geekflare:~$ wget https://packages.chef.io/files/stable/chef-server/13.0.17/ubuntu/18.04/chef-server-core_13.0.17-1_amd64.deb

--2019-10-23 04:04:35-- https://packages.chef.io/files/stable/chef-server/13.0.17/ubuntu/18.04/chef-server-core_13.0.17-1_amd64.deb

Saving to: ‘chef-server-core_13.0.17-1_amd64.deb’

chef-server-core_13 100%[===================>] 240.58M 1.33MB/s in 6m 16s 

2019-10-23 04:10:51 (656 KB/s) - ‘chef-server-core_13.0.17-1_amd64.deb’ saved [252269838/252269838]

Vous devez maintenant exécuter la commande suivante pour installer le serveur chef.

geekflare@chef-geekflare:~$ sudo dpkg -i chef-server-core_*.deb

chef-server-ctl est un utilitaire de ligne de commande dans chef-server. J'utiliserai cet utilitaire pour démarrer les services chef-serveur.

geekflare@chef-geekflare:~$ sudo chef-server-ctl reconfigure

Running handlers:

Running handlers complete

Chef Infra Client finished, 481/1028 resources updated in 04 minutes 08 seconds

Chef Server Reconfigured!

Vous pouvez vérifier l'état des services qui ont démarré à l'aide de la commande ci-dessous.

geekflare@chef-geekflare:~$ sudo chef-server-ctl status

run: bookshelf: (pid 2452) 822s; run: log: (pid 29553) 951s

run: nginx: (pid 2318) 826s; run: log: (pid 30216) 908s

run: oc_bifrost: (pid 2296) 827s; run: log: (pid 29240) 996s

run: oc_id: (pid 2304) 826s; run: log: (pid 29308) 979s

run: opscode-erchef: (pid 2511) 822s; run: log: (pid 29707) 946s

run: opscode-expander: (pid 2416) 822s; run: log: (pid 29412) 958s

run: opscode-solr4: (pid 2393) 824s; run: log: (pid 29358) 964s

run: postgresql: (pid 2264) 827s; run: log: (pid 28769) 1021s

run: rabbitmq: (pid 3183) 792s; run: log: (pid 30476) 902s

run: redis_lb: (pid 30011) 926s; run: log: (pid 30010) 926s

Create User and Organization

Le serveur Chef connecte le poste de travail et les nœuds clients. Pour les lier, je vais créer un administrateur et un organisateur avec leurs clés privées.

 Tout d'abord, créez un répertoire .chef pour stocker les clés.

geekflare@chef-geekflare:~$ mkdir .chef

Maintenant, je vais utiliser chef-server-ctl pour créer un utilisateur. Dans la commande ci-dessous, chefadmin est l'utilisateur, Chef est le prénom, GeekFlare est le nom de famille, chefadmin@geekflare.com est l'identifiant de l'e-mail, geekflare est le mot de passe, chefadmin.pen est la clé RSA.

geekflare@chef-geekflare:~$ sudo chef-server-ctl user-create chefadmin Chef GeekFlare chefadmin@geekflare.com 'geekflare' --filename ~/.chef/chefadmin.pem

Lançons une commande pour vérifier la liste des utilisateurs sur le serveur chef.

geekflare@chef-geekflare:~$ sudo chef-server-ctl user-list

chefadmin

pivotal

Maintenant, j'utiliserai chef-server-ctl pour créer une organisation. Dans la commande ci-dessous, chef-org est le nom de l'organisation, Geekflare Chef Infrastructure est le nom complet de l'organisation, chefadmin est l'utilisateur que nous venons de créer., Chef-org.pem est la clé RSA.

geekflare@chef-geekflare:~$ sudo chef-server-ctl org-create chef-org "Geekflare Chef Infrastructure" --association_user chefadmin --filename ~/.chef/chef-org.pem

 Lançons une commande pour vérifier la liste des organisations sur le serveur chef.

geekflare@chef-geekflare:~$ sudo chef-server-ctl org-list

chef-org

J'ai complètement installé le chef-server, allons-y et installons le poste de travail où toutes les configurations sont créées.

Workstation

Workstation est le lieu où les utilisateurs créent des livres de cuisine. Les livres de recettes ne sont rien d'autre que les unités de configuration créées pour exécuter des tâches spécifiques.

Exécutons la commande ci-dessous pour télécharger le package du poste de travail chef.

geekflare@chef-workstation:~$ wget https://packages.chef.io/files/stable/chef-workstation/0.2.43/ubuntu/18.04/chef-workstation_0.2.43-1_amd64.deb

--2019-10-23 05:37:41-- https://packages.chef.io/files/stable/chef-workstation/0.2.43/ubuntu/18.04/chef-workstation_0.2.43-1_amd64.deb

Resolving packages.chef.io (packages.chef.io)... 151.101.194.110, 151.101.130.110, 151.101.66.110, ...

Connecting to packages.chef.io (packages.chef.io)|151.101.194.110|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 129713682 (124M) [application/x-debian-package]

Saving to: ‘chef-workstation_0.2.43-1_amd64.deb’

chef-workstation_0.2.43-1_ 100%[=======================================>] 123.70M 2.37MB/s in 4m 25s 

2019-10-23 05:42:18 (477 KB/s) - ‘chef-workstation_0.2.43-1_amd64.deb’ saved [129713682/129713682]

Exécutons la commande dpkg pour installer un poste de travail sur le système ubuntu.

geekflare@chef-workstation:~$ sudo dpkg -i chef-workstation_*.deb

Selecting previously unselected package chef-workstation.

(Reading database ... 273360 files and directories currently installed.)

Preparing to unpack chef-workstation_0.2.43-1_amd64.deb ...

Unpacking chef-workstation (0.2.43-1) ...

Setting up chef-workstation (0.2.43-1) ...

To run the experimental Chef Workstation App, use your

platform's package manager to install these dependencies:

               libgconf-2.so.4 => not found

You can then launch the App by running 'chef-workstation-app'.

The App will then be available in the system tray.

Thank you for installing Chef Workstation!

You can find some tips on getting started at https://chef.sh/

Je vais maintenant exécuter une commande pour créer un référentiel chef qui contiendra tous les livres de cuisine et autres fichiers.

geekflare@chef-workstation:~$ chef generate repo chef-repo

Recipe: code_generator::repo

 * directory[/home/geekflare/chef-repo] action create

   - create new directory /home/geekflare/chef-repo

 * template[/home/geekflare/chef-repo/LICENSE] action create_if_missing

   - create new file /home/geekflare/chef-repo/LICENSE

   - update content in file /home/geekflare/chef-repo/LICENSE from none to 3c525c

   (diff output suppressed by config)

 * cookbook_file[/home/geekflare/chef-repo/.chef-repo.txt] action create_if_missing

   - create new file /home/geekflare/chef-repo/.chef-repo.txt

   - update content in file /home/geekflare/chef-repo/.chef-repo.txt from none to 2bed28

   (diff output suppressed by config)

 * cookbook_file[/home/geekflare/chef-repo/README.md] action create_if_missing

   - create new file /home/geekflare/chef-repo/README.md

   - update content in file /home/geekflare/chef-repo/README.md from none to 2b4f46

   (diff output suppressed by config)

 * cookbook_file[/home/geekflare/chef-repo/chefignore] action create_if_missing

   - create new file /home/geekflare/chef-repo/chefignore

   - update content in file /home/geekflare/chef-repo/chefignore from none to 9e2ffd

   (diff output suppressed by config)

 * remote_directory[/home/geekflare/chef-repo/cookbooks] action create_if_missing

   - create new directory /home/geekflare/chef-repo/cookbooks 

Recipe: code_generator::repo

 * cookbook_file[/home/geekflare/chef-repo/cookbooks/README.md] action create_if_missing

   - create new file /home/geekflare/chef-repo/cookbooks/README.md

   - update content in file /home/geekflare/chef-repo/cookbooks/README.md from none to 54b03d

   (diff output suppressed by config)

 * execute[initialize-git] action run

   - execute git init .

 * template[/home/geekflare/chef-repo/.gitignore] action create_if_missing

   - create new file /home/geekflare/chef-repo/.gitignore

   - update content in file /home/geekflare/chef-repo/.gitignore from none to 11e5ee

   (diff output suppressed by config)

Maintenant je vais créer /chef-repo/.chef répertoire, qui stockera toutes les configurations de couteau et les clés RSA.

geekflare@chef-workstation:~$ mkdir ~/chef-repo/.chef

geekflare@chef-workstation:~$ cd chef-repo/ 

Maintenant, générons une paire de clés RSA. Nous générons cette clé pour authentifier le poste de travail et accéder au serveur chef.

geekflare@chef-workstation:~/chef-repo$ ssh-keygen -b 4096

Generating public/private RSA key pair.

Enter file in which to save the key (/home/geekflare/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/geekflare/.ssh/id_rsa.

Your public key has been saved in /home/geekflare/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:oK/ZyLn+AOMj97F5Z0e1K5o1bxChyKx3ms4HvK06DxI geekflare@chef-geekflare

The key's randomart image is:

+---[RSA 4096]----+

| |

| . |

| o.. . . |

| .+.. . . |

| E .o S o . |

| . +..+ . o . |

|. = +..B .o. . |

| o =.&= =oooo |

| .&OB=oo o. |

+----[SHA256]-----+

Copiez maintenant la clé sur le serveur chef à partir du poste de travail.

geekflare@chef-workstation:~/chef-repo$ sudo ssh-copy-id geekflare@192.168.0.107

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/geekflare/.ssh/id_rsa.pub"

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

geekflare@192.168.0.107's password:

Number of key(s) added: 1

Now try logging into the machine, with: "ssh 'geekflare@192.168.0.107'"

and check to make sure that only the key(s) you wanted were added.

Maintenant, je vais copier les fichiers .pem (chefadmin.pem et chef-org.pem) du serveur chef vers le poste de travail.

geekflare@chef-workstation:~/chef-repo$ scp geekflare@192.168.0.107:~/.chef/*.pem ~/chef-repo/.chef/

chefadmin.pem 100% 1674 105.1KB/s 00:00   

chef-org.pem 100% 1674 103.0KB/s 00:00

Vérifiez si les fichiers .pem ont été copiés avec succès sur le poste de travail.

geekflare@chef-workstation:~/chef-repo$ ls ~/chef-repo/.chef

chefadmin.pem chef-org.pem

Create Version Control

Lorsque vous travaillez sur un poste de travail, de nombreux changements et modifications se produisent dans les livres de recettes (unités de configuration), de sorte qu'un système de contrôle de version est nécessaire pour suivre ces changements. Alors, allons-y et créons un système de contrôle de version en utilisant Git sur le poste de travail. Je vais créer un dépôt git dans le répertoire chef-repo. Je vais ajouter un nom d'utilisateur et un e-mail pour configurer git

geekflare@chef-workstation:~$ git config --global user.name geekflare

geekflare@chef-workstation:~$ git config --global user.email avi@geekflare.com

Ajoutons le répertoire .chef au fichier .gitignore.

geekflare@chef-workstation:~$ echo ".chef" > ~/chef-repo/.gitignore

Maintenant, je vais exécuter les commandes add et commit git à partir d'un répertoire chef-repo.

geekflare@chef-workstation:~$ cd ~/chef-repo

geekflare@chef-workstation:~/chef-repo$ git add .

geekflare@chef-workstation:~/chef-repo$ git commit -m "initial commit"

[master (root-commit) 99c8c11] initial commit

 16 files changed, 359 insertions(+)

 create mode 100644 .chef-repo.txt

 create mode 100644 .gitignore

 create mode 100644 LICENSE

 create mode 100644 README.md

 create mode 100644 chefignore

 create mode 100644 cookbooks/README.md

 create mode 100644 cookbooks/example/README.md

 create mode 100644 cookbooks/example/attributes/default.rb

 create mode 100644 cookbooks/example/metadata.rb

 create mode 100644 cookbooks/example/recipes/default.rb

 create mode 100644 data_bags/README.md

 create mode 100644 data_bags/example/example_item.json

 create mode 100644 environments/README.md

 create mode 100644 environments/example.json

 create mode 100644 roles/README.md

 create mode 100644 roles/example.json

Vérifiez l'état.

geekflare@chef-workstation:~/chef-repo$ git status

On branch master

nothing to commit, working tree clean

Generate Your First CookBook

L'installation de WorkStation est maintenant terminée et vous pouvez commencer à créer des livres de recettes sur la WorkStation. Essayez de générer un exemple de livre de recettes sur la station de travail et voyez s'il est généré avec succès.

Je vais exécuter la commande ci-dessous pour générer un livre de recettes.

geekflare@chef-workstation:~$ Chef generate cookbook geekflare_cookbook

Generating cookbook geekflare_cookbook

- Ensuring correct cookbook file content

- Committing cookbook files to Git

- Ensuring delivery configuration

- Ensuring correct delivery build cookbook content

- Adding delivery configuration to feature branch

- Adding build cookbook to feature branch

- Merging delivery content feature branch to master

Your cookbook is ready. Type `cd geekflare_cookbook` to enter it.

There are several commands you can run to get started locally developing and testing your cookbook.

Type `delivery local --help` to see a full list.

Why not start by writing a test? Tests for the default recipe are stored at:

test/integration/default/default_test.rb

If you'd prefer to dive right in, the default recipe can be found at:

recipes/default.rb

Générez chef-repo, puis déplacez-vous vers un répertoire chef-repo

geekflare@chef-workstation:~$ Chef generate app chef-repo

WARNING: The command 'chef generator app' is deprecated and will be removed from the next major release of Chef DK / Workstation (April 2019)

Recipe: code_generator::app

 * directory[/home/geekflare/chef-repo] action create (up to date)

 * template[/home/geekflare/chef-repo/.kitchen.yml] action create

   - create new file /home/geekflare/chef-repo/.kitchen.yml

   - update content in file /home/geekflare/chef-repo/.kitchen.yml from none to ceae09

   (diff output suppressed by config)

 * directory[/home/geekflare/chef-repo/test/integration/default] action create

   - create new directory /home/geekflare/chef-repo/test/integration/default

 * template[/home/geekflare/chef-repo/test/integration/default/default_test.rb] action create_if_missing

   - create new file /home/geekflare/chef-repo/test/integration/default/default_test.rb

   - update content in file /home/geekflare/chef-repo/test/integration/default/default_test.rb from none to 0f757b

   (diff output suppressed by config)

 * template[/home/geekflare/chef-repo/README.md] action create

   - update content in file /home/geekflare/chef-repo/README.md from 2b4f46 to 6401b8

   (diff output suppressed by config)

 * directory[/home/geekflare/chef-repo/cookbooks] action create (up to date)

 * directory[/home/geekflare/chef-repo/cookbooks/chef-repo] action create

   - create new directory /home/geekflare/chef-repo/cookbooks/chef-repo

 * template[/home/geekflare/chef-repo/cookbooks/chef-repo/metadata.rb] action create

   - create new file /home/geekflare/chef-repo/cookbooks/chef-repo/metadata.rb

   - update content in file /home/geekflare/chef-repo/cookbooks/chef-repo/metadata.rb from none to e30be3

   (diff output suppressed by config)

 * cookbook_file[/home/geekflare/chef-repo/cookbooks/chef-repo/chefignore] action create

   - create new file /home/geekflare/chef-repo/cookbooks/chef-repo/chefignore

   - update content in file /home/geekflare/chef-repo/cookbooks/chef-repo/chefignore from none to 9e2ffd

   (diff output suppressed by config)

 * cookbook_file[/home/geekflare/chef-repo/cookbooks/chef-repo/Berksfile] action create

   - create new file /home/geekflare/chef-repo/cookbooks/chef-repo/Berksfile

   - update content in file /home/geekflare/chef-repo/cookbooks/chef-repo/Berksfile from none to 15e000

   (diff output suppressed by config)

 * directory[/home/geekflare/chef-repo/cookbooks/chef-repo/recipes] action create

   - create new directory /home/geekflare/chef-repo/cookbooks/chef-repo/recipes

 * template[/home/geekflare/chef-repo/cookbooks/chef-repo/recipes/default.rb] action create

   - create new file /home/geekflare/chef-repo/cookbooks/chef-repo/recipes/default.rb

   - update content in file /home/geekflare/chef-repo/cookbooks/chef-repo/recipes/default.rb from none to f56ecb

   (diff output suppressed by config)

 * directory[/home/geekflare/chef-repo/cookbooks/chef-repo/spec/unit/recipes] action create

   - create new directory /home/geekflare/chef-repo/cookbooks/chef-repo/spec/unit/recipes

 * cookbook_file[/home/geekflare/chef-repo/cookbooks/chef-repo/spec/spec_helper.rb] action create_if_missing

   - create new file /home/geekflare/chef-repo/cookbooks/chef-repo/spec/spec_helper.rb

   - update content in file /home/geekflare/chef-repo/cookbooks/chef-repo/spec/spec_helper.rb from none to 1f80e1

   (diff output suppressed by config)

 * template[/home/geekflare/chef-repo/cookbooks/chef-repo/spec/unit/recipes/default_spec.rb] action create_if_missing

   - create new file /home/geekflare/chef-repo/cookbooks/chef-repo/spec/unit/recipes/default_spec.rb

   - update content in file /home/geekflare/chef-repo/cookbooks/chef-repo/spec/unit/recipes/default_spec.rb from none to 666a01

   (diff output suppressed by config)

 * execute[initialize-git] action run

   - execute git init .

 * cookbook_file[/home/geekflare/chef-repo/.gitignore] action create

   - update content in file /home/geekflare/chef-repo/.gitignore from 25558e to edcd62

   (diff output suppressed by config)

Configure Knife

Knife est un outil de ligne de commande pour gérer les nœuds, les livres de cuisine et les recettes. Pour configurer Knife, créez un fichier config.rb et mettez le contenu ci-dessous dans le fichier, ce sont des configurations de couteau.

geekflare@chef-workstation:~$ sudo gedit ~/chef-repo/.chef/config.rb
current_dir = File.dirname(__FILE__)

log_level :info

log_location STDOUT

node_name 'chefadmin'

client_key "chefadmin.pem"

validation_client_name 'chef-org-validator'

validation_key "chef-org-validator.pem"

chef_server_url 'https://chef-geekflare/organizations/chef-org'

cache_type 'BasicFile'

cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )

cookbook_path ["#{current_dir}/../cookbooks"]

Accédez maintenant à un répertoire chef-repo et copiez les certificats SSL.

geekflare@chef-workstation:~$ cd chef-repo

geekflare@chef-workstation:~/chef-repo$ knife ssl fetch

WARNING: Certificates from chef-geekflare will be fetched and placed in your trusted_cert

directory (/home/geekflare/chef-repo/.chef/trusted_certs).

Knife has no means to verify these are the correct certificates. You should

verify the authenticity of these certificates after downloading.

Adding certificate for chef-geekflare in /home/geekflare/chef-repo/.chef/trusted_certs/chef-geekflare.crt

Pour vérifier que config.rb est correctement défini, exécutez la commande ci-dessous.

geekflare@chef-workstation:~/chef-repo$ knife client list

chef-org-validator

Bootstrap a Node

Bootstrap s'exécute à partir de la machine du poste de travail et installe le client chef sur les nœuds. Les nœuds peuvent ensuite lire les configurations à partir du serveur chef en utilisant l'utilisateur et le mot de passe du nœud client pour amorcer un nœud.

Je vais maintenant démarrer un nœud avec l'adresse IP 192.168.0.109, le nom d'utilisateur geekflare et le mot de passe geekflare.org.

geekflare@chef-workstation:~/chef-repo/.chef$ knife bootstrap 192.168.0.109 -x geekflare -P geekflare.org --node-name geekflare-client-1

Creating new client for geekflare-client-1

Creating new node for geekflare-client-1

Connecting to 192.168.0.109

192.168.0.109 -----> Installing Chef Omnibus (-v 14)

192.168.0.109 downloading https://omnitruck-direct.chef.io/chef/install.sh

192.168.0.109 to file /tmp/install.sh.9250/install.sh

192.168.0.109 trying wget...

192.168.0.109 ubuntu 18.10 x86_64

192.168.0.109 Getting information for chef stable 14 for ubuntu...

192.168.0.109 downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=14&p=ubuntu&pv=18.10&m=x86_64

192.168.0.109 to file /tmp/install.sh.9261/metadata.txt

192.168.0.109 trying wget...

192.168.0.109 sha1 534bae390bde3bd9d93bef99335f62246624f32b

192.168.0.109 sha256 94bc60b3a97ddadf77a70c7678ec77a676942c74f8152a2c70a0f5b68e22a42e

192.168.0.109 url https://packages.chef.io/files/stable/chef/14.14.25/ubuntu/18.04/chef_14.14.25-1_amd64.deb

192.168.0.109 version 14.14.25

192.168.0.109 downloaded metadata file looks valid...

192.168.0.109 downloading https://packages.chef.io/files/stable/chef/14.14.25/ubuntu/18.04/chef_14.14.25-1_amd64.deb

192.168.0.109 to file /tmp/install.sh.9261/chef_14.14.25-1_amd64.deb

192.168.0.109 trying wget...

192.168.0.109 Comparing checksum with sha256sum...

192.168.0.109 Installing chef 14

192.168.0.109 installing with dpkg...

192.168.0.109 Selecting previously unselected package chef.

(Reading database ... 204803 files and directories currently installed.)

192.168.0.109 Preparing to unpack .../chef_14.14.25-1_amd64.deb ...

192.168.0.109 Unpacking chef (14.14.25-1) ...

192.168.0.109 Setting up chef (14.14.25-1) ...

192.168.0.109 Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io

192.168.0.109 Starting the first Chef Client run...

192.168.0.109 Starting Chef Client, version 14.14.25

192.168.0.109 resolving cookbooks for run list: []

192.168.0.109 Synchronizing Cookbooks:

192.168.0.109 Installing Cookbook Gems:

192.168.0.109 Compiling Cookbooks...

192.168.0.109 [2019-10-23T10:52:57-04:00] WARN: Node geekflare-client-1 has an empty run list.

192.168.0.109 Converging 0 resources

192.168.0.109

192.168.0.109 Running handlers:

192.168.0.109 Running handlers complete

192.168.0.109 Chef Client finished, 0/0 resources updated in 07 seconds

Je vais maintenant lister tous les nœuds qui ont été bootstrapés

geekflare@chef-workstation:~/chef-repo/.chef$ knife node list

geekflare-client-1

Exécutez la commande ci-dessous pour obtenir les détails du nœud.

geekflare@chef-workstation:~/chef-repo/.chef$ knife node show geekflare-client-1

Node Name: geekflare-client-1

Environment: _default

FQDN: client-node

IP: 192.168.0.109

Run List:   

Roles:      

Recipes:    

Platform: ubuntu 18.10

Tags:

Maintenant, la configuration est prête!

Nous avons installé avec succès un serveur chef, une station de travail et un nœud sur Ubuntu. Vous pouvez continuer et commencer à créer des recettes et des livres de recettes dans Chef pour la gestion de la configuration de l'infrastructure.

Si vous êtes un débutant absolu, vous aimerez peut-être prendre ceci Cours Udemy trop.

Merci à nos commanditaires
Plus de bonnes lectures sur DevOps
Alimentez votre entreprise
Certains des outils et services pour aider votre entreprise à se développer.
  • Invicti utilise Proof-Based Scanning™ pour vérifier automatiquement les vulnérabilités identifiées et générer des résultats exploitables en quelques heures seulement.
    Essayez Invicti
  • Web scraping, proxy résidentiel, proxy manager, web unlocker, moteur de recherche et tout ce dont vous avez besoin pour collecter des données Web.
    Essayez Brightdata
  • Semrush est une solution de marketing numérique tout-en-un avec plus de 50 outils de référencement, de médias sociaux et de marketing de contenu.
    Essayez Semrush
  • Intruder est un scanner de vulnérabilités en ligne qui détecte les failles de cybersécurité de votre infrastructure, afin d'éviter des violations de données coûteuses.
    Essayez Intruder