Need help! Stuck on installing Azure client to agent

28 views
Skip to first unread message

banthi...@truedigital.com

unread,
Mar 26, 2019, 6:11:17 AM3/26/19
to Puppet Users
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

------------------------------------------------------------------------------------------------

Important

Confidentiality: This Information is intended for the above-named person and may contain confidential and/or legally privileged material. Any opinions expressed in this information are not necessarily those of the company. If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.

Monitoring/Viruses
True Digital Group and subsidiaries reserves the right to monitor all incoming and outgoing emails via True Digital Group and subsidiaries's systems. Although we have security program to monitor and eliminate virus, we also advise that in keeping with good computing practice the recipient should ensure they are actually virus free.

comport3

unread,
Mar 28, 2019, 3:18:02 PM3/28/19
to Puppet Users
You require Package[azurerepo] but haven't declared it anywhere.

Try either changing:
  require => Package['azurerepo']
to
  require => Yumrepo['azurerepo']

or add a package definition, eg.

package { 'azurerepo': ensure => present}
Reply all
Reply to author
Forward
0 new messages