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 
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

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.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b78a1fdd-695e-4790-b666-812afb49ba43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to