This blog explains how to configure chef infra server in WSL2 in Windows 10/11.
Prerequisites:
- WSL2 with Ubuntu 20.04 installed
Let's get started,
- Go to https://www.chef.io/downloads/tools/infra-server/ and download the relevant infra server.
- Copy downloaded .deb file to your work folder.
- Open WSL2 and run the following command to install the chef infra server on WSL2
sudo dpkg -i chef-server-core-<version>.deb
sudo chef-server-ctl reconfigure
Above command might fail with the error, "System has not been booted with systemd as init system (PID 1). Can't operate" . You can follow this blog to solve the failure.
- Once all the services are started, run following command to create administrator. provide username, first name, Last name, Email, password and .pem filename with the command.
sudo chef-server-ctl user-create USER_NAME FIRST_NAME LAST_NAME EMAIL 'PASSWORD' --filename FILE_NAME
Once command is successful, RSA private key will be generated and added value to the file name given.
- Run following command to create Chef organization. Provide short name of organization, full organization name, user name and filename (ex: <<Organization short name>>-validator.pem)
sudo chef-server-ctl org-create short_name 'full_organization_name' --association_user user_name --filename ORGANIZATION-validator.pem
Once organization creation command run successfully, you would be able to find the .pem file in provided file path
- Go to https://localhost:443 to access the Chef Infra server.
Further, you can configure Chef management console to manage nodes, data bags, roles, environments and cookbook using web User Interface.
No comments:
Post a Comment