Hi! I've been trying to install Azure client to agent by using puppet following this
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest
Already installed on Master but stuck on installing to agent.
from the guideline above it has 3 parts
1. import Microsoft repository key by using command
2. Create local azure-cli repository information.
Since Azure installed on master so I copy the local repo and move to specific path which is in /modules/os_preparation/files/repolist/azure-cli.repo
3. Install with Yum command
sudo yum install azure-cli
And here're my code
class os_preparation::azure_install {
#Import the Microsoft repository key.
yumrepo { 'azurerepo':
baseurl => 'https://packages.microsoft.com/keys/microsoft.asc',
gpgcheck => 0
}
file { 'azure-cli.repo in /etc/yum.repos.d/':
ensure => 'file',
path => '/etc/yum.repos.d/azure-cli.repo',
owner => 'root',
group => 'root',
mode => '644',
source => "puppet:///modules/os_preparation/files/repolist/azure-cli.repo",
require => Package['azurerepo']
}
exec { 'yumrepolist':
command => 'yum -y repolist',
path => '/etc/yum.repos.d/azure-cli.repo'
}
#install azure client
exec { 'install-azure':
command => 'yum -y install azure-cli',
path => '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:',
unless => 'az --help',
require => File['/etc/yum.repos.d/azure-cli.repo']
}
}
ps. In part 1 not sure for azurerepo, It might be package or yumrepo ?
and errors from some puppet agent
[root@mtg8-dt-02 ~]# puppet agent -t
2019-03-26 16:26:58.215715 WARN puppetlabs.facter - locale environment variables were bad; continuing with LANG=C LC_ALL=C
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Package[azurerepo]' in parameter 'require' (file: /etc/puppetlabs/code/environments/production/modules/os_preparation/manifests/azure_install.pp, line: 17) on node mtg8-dt-02.tap.true.th
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Any suggestions would be great, I really appreciate
Thanks