Chef를 사용하여 Arch Linux를 부트스트랩하는 쉬운 방법이 있습니까?

Chef를 사용하여 Arch Linux를 부트스트랩하는 쉬운 방법이 있습니까?

나는 Arch Linux가 Chef.io에서 지원되지 않는다는 것을 알고 있지만 어쨌든 Knife Bootstrap을 사용하여 Arch Linux 노드를 부트스트랩할 수 있습니까?

Debian 컴퓨터에서 사용하는 것과 동일한 명령을 시도했지만 오류가 발생합니다.

knife bootstrap 10.2.128.80 --ssh-identity-file ~/.ssh/id_rsa --connection-user myUser -N webserver --environment staging --bootstrap-version 18 -y --sudo
Connecting to 10.2.128.80 using ssh
Connecting to 10.2.128.80 using ssh

DEBUG: [SSH] [email protected] cmd = cmd.exe /c ver
DEBUG: [SSH] [email protected] cmd = Get-WmiObject Win32_OperatingSystem | Select Caption,Version | ConvertTo-Json
DEBUG: [SSH] [email protected] cmd = uname -s
DEBUG: [SSH] [email protected] cmd = uname -m
DEBUG: [SSH] [email protected] cmd = test -f /etc/debian_version
DEBUG: [SSH] [email protected] cmd = test -f /etc/os-release && cat /etc/os-release
DEBUG: [SSH] [email protected] cmd = show version
DEBUG: [SSH] [email protected] cmd = test -f /etc/lsb-release && cat /etc/lsb-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/oracle-release && cat /etc/oracle-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/enterprise-release && cat /etc/enterprise-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/parallels-release && cat /etc/parallels-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/system-release && cat /etc/system-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/redhat-release && cat /etc/redhat-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/SuSE-release && cat /etc/SuSE-release
DEBUG: [SSH] [email protected] cmd = test -f /etc/arch-release
DEBUG: [SSH] [email protected] cmd = uname -r
DEBUG: [SSH] [email protected] cmd = sh -c '(sudo echo) < /dev/null'
DEBUG: [SSH] [email protected] cmd = sudo echo '[SSH] Established'
WARNING: Performing legacy client registration with the validation key at /home/myUser/.chef/org-validator.pem...
WARNING: Remove the key file or remove the 'validation_key' configuration option from your config.rb (knife.rb) to use more secure user credentials for client registration.
TRACE: Looking for bootstrap template in /opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/knife-18.2.7/lib/chef/knife/bootstrap/templates
TRACE: Found bootstrap template: /opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/knife-18.2.7/lib/chef/knife/bootstrap/templates/chef-full.erb
Bootstrapping 10.2.128.80
DEBUG: [SSH] [email protected] cmd = sudo sh /tmp/chef_T472LE/bootstrap.sh
 [10.2.128.80] -----> Installing Chef Omnibus (stable/18)
downloading https://omnitruck.chef.io/chef/install.sh
  to file /tmp/install.sh.32304/install.sh
 [10.2.128.80] trying wget...
 [10.2.128.80] "arch" "rolling" x86_64
 [10.2.128.80] Getting information for chef stable 18 for "arch"...
 [10.2.128.80] downloading https://omnitruck.chef.io/stable/chef/metadata?v=18&p="arch"&pv="rolling"&m=x86_64
  to file /tmp/install.sh.32308/metadata.txt
 [10.2.128.80] trying wget...
 [10.2.128.80] ERROR 404
 [10.2.128.80] Omnitruck artifact does not exist for version 18 on platform "arch"

Either this means:
   - We do not support "arch"
   - We do not have an artifact for 18

 [10.2.128.80] This is often the latter case due to running a prerelease or RC version of Chef
or a gem version which was only pushed to rubygems and not omnitruck.

You may be able to set your knife[:bootstrap_version] to the most recent stable
release of Chef to fix this problem (or the most recent stable major version number).

In order to test the version parameter, adventurous users may take the Metadata URL
 [10.2.128.80] below and modify the '&v=<number>' parameter until you successfully get a URL that
does not 404 (e.g. via curl or wget).  You should be able to use '&v=11' or '&v=12'
 [10.2.128.80] successfully.

 [10.2.128.80] If you cannot fix this problem by setting the bootstrap_version, it probably means
that "arch" is not supported.
 [10.2.128.80]
Metadata URL: https://omnitruck.chef.io/stable/chef/metadata?v=18&p="arch"&pv="rolling"&m=x86_64
 [10.2.128.80] Starting the first Chef Infra Client Client run...
 [10.2.128.80] /tmp/chef_T472LE/bootstrap.sh: line 364: chef-client: command not found
ERROR: The following error occurred on 10.2.128.80:
ERROR: -----> Installing Chef Omnibus (stable/18)
     downloading https://omnitruck.chef.io/chef/install.sh
       to file /tmp/install.sh.32304/install.sh
     trying wget...
     "arch" "rolling" x86_64
     Getting information for chef stable 18 for "arch"...
     downloading https://omnitruck.chef.io/stable/chef/metadata?v=18&p="arch"&pv="rolling"&m=x86_64
       to file /tmp/install.sh.32308/metadata.txt
     trying wget...
     ERROR 404
     Omnitruck artifact does not exist for version 18 on platform "arch"

     Either this means:
        - We do not support "arch"
        - We do not have an artifact for 18

     This is often the latter case due to running a prerelease or RC version of Chef
     or a gem version which was only pushed to rubygems and not omnitruck.

     You may be able to set your knife[:bootstrap_version] to the most recent stable
     release of Chef to fix this problem (or the most recent stable major version number).

     In order to test the version parameter, adventurous users may take the Metadata URL
     below and modify the '&v=<number>' parameter until you successfully get a URL that
     does not 404 (e.g. via curl or wget).  You should be able to use '&v=11' or '&v=12'
     successfully.

     If you cannot fix this problem by setting the bootstrap_version, it probably means
     that "arch" is not supported.

     Metadata URL: https://omnitruck.chef.io/stable/chef/metadata?v=18&p="arch"&pv="rolling"&m=x86_64
     Starting the first Chef Infra Client Client run...
      /tmp/chef_T472LE/bootstrap.sh: line 364: chef-client: command not found
DEBUG: [SSH] [email protected] cmd = sudo rm -f "/tmp/chef_T472LE/bootstrap.sh"

Arch Linux는 지원되지 않기 때문에 다운로드할 파일을 찾을 수 없다는 것을 이해합니다.다음 URL.

지원되는 OS라고 생각하도록 속일 수 있는 방법이 있나요? 데비안 설치용 파일을 다운로드할 수 있다면 설치의 나머지 부분은 여전히 ​​작동합니까?

답변1

나는 그것을하는 방법을 알아 냈습니다.

기본적으로 패키지를 설치하기만 하면 됩니다.chef-clientknife bootstrap --bootstrap-install-command플래그를 사용하여 AUR에서

개인적으로 내 설정에는 루트 외에는 사용자가 없으므로 다음을 사용합니다.이 스크립트:

--bootstrap-install-command "curl -sSf https://repo.barata.pt/-/snippets/9/raw/master/bootstrap-arch.sh | sh"

테스트하지는 않았지만 비밀번호가 구성되지 않은 sudo를 사용하여 사용자로 컴퓨터에 연결하면 다음과 같이 작동합니다.

pacman --noconfirm -S wget base-devel
cd /tmp
wget --no-verbose https://aur.archlinux.org/cgit/aur.git/snapshot/chef-client.tar.gz
tar -xvf chef-client.tar.gz
cd chef-client
makepkg -si --noconfirm
cd ..
rm -rf chef-clien*

전체 공개,chef-clientAUR 패키지는 현재 내가 관리하고 있습니다.

관련 정보