AideMemoire: Difference between revisions

From T2B Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=== Quick Summary ===


=== How to use ncm-metaconfig ? ===
[0. on first time only] Edit '''sites/iihe-production/site/repositories.pan''' + runcheck<br>
The official documentation can be found [https://github.com/quattor/configuration-modules-core/blob/master/ncm-metaconfig/src/main/perl/metaconfig.pod here].
1. update repository:
::On '''proxy''', run /scripts/proxy/manage_repositories.pl --sync MY_REPO_NAME<br>
:''OR''    On '''proxy''' add rpm to your repo in '''/var/www/html/local_repositories/'''<br>
2. Make new snapshot:
: On '''proxy''', run /scripts/proxy/manage_repositories.pl --snapshot MY_REPO_NAME<br>
3. Update snapshot date in quattor:
:Edit '''sites/iihe-production/site/repositories.pan''' and modify the snapshot date in '''REPOSITORIES''' dict, ''OR'' to add new snapshot date for only one machine add the line
variable REPO_YUM_SNAPSHOT_DATE = update_snapshot_date_for_host('icinga2', 'sl6_epel', '1454598887');


Here is an example ready to be included into a machine profile for test purposes :
<pre>
# first, you need to deploy the tt file on the machine
# (the standard way is to include tt files in the the ncm-metaconfig rpm....)
variable CONTENTS = <<EOF;
name = {
[% FILTER indent -%]
hosts = [% hosts.join(',') %]
port = [% port %]
master = [% master ? "TRUE" : "FALSE" %]
description = "[% description %]"
[%    IF option.defined -%]
option = "[% option %]"
[%    END -%]
[% END -%]
}
EOF
'/software/components/filecopy/services' = npush(
escape('/usr/share/templates/quattor/metaconfig/example/main.tt'), nlist('config', CONTENTS, 'perms', '0644')
);


# below, the real metaconfig work
=== I. Prepare the repo on the proxy server ===
include 'components/metaconfig/config';
 
include 'metaconfig/example/config';
==== a. Quattor config ====
prefix '/software/components/metaconfig/services/{/etc/example/exampled.conf}/contents';
You need to edit the file '''sites/iihe-production/site/repositories.pan''' and add your repository here:
'hosts' = list('server1', 'server3');
<pre>    'elastic_5x_el', dict('descr', 'Elastic repository for 5.x packages',
'port' = 800;
                      'url', 'https://artifacts.elastic.co/packages/5.x/yum',
'master' = false;
                      'mirror', true,
'description' = 'My example';
                      'snapshot_date', '1504525687'
                  ),


# the tt file must be created before ncm-metaconfig runs
'/software/components/metaconfig/dependencies/pre' = push('filecopy');
</pre>
</pre>


For this example to work, you need a directory metaconfig/example in your site, with the following content :
The repo name needs to follow those requirements:<br>
 
1. First the repo name, with version if available<br>
* config.pan :
2 The '''el''' version it is for: '''el6''' | '''el7''' | '''el'''
<pre>
:* '''el''' is if it works on whatever OS release number.
unique template metaconfig/example/config;
:* '''el7''' repos should work for both sl7x and cos7x OS for instance
 
3. The architecture: '''x86_64''' | '''noarch'''
include {'metaconfig/example/schema'};
:* If the repo contains packages for x86 & noarch, then omit the arch requirement
 


bind "/software/components/metaconfig/services/{/etc/example/exampled.conf}/contents" = example_service;


prefix "/software/components/metaconfig/services/{/etc/example/exampled.conf}";
There are '''3''' types of repositories: '''mirrored''', '''local''' or '''direct''' repos.
"daemon" = list("exampled");
"module" = "example/main";
</pre>


* schema.pan :
1. '''mirrorred''' repos are the most common ones: they will have a local mirror on our proxy, and are snapshoted.<br>
<pre>
: To declare such a repo, the following fields are required:
declaration template metaconfig/example/schema;
:*distant '''url''',
:*'''mirror''' set to '''true'''
:* a '''snapshot_date''' (see step X.Y)


include { 'pan/types' };
2. '''local''' repos are our private ones, where we put ~random packages. They are snapshoted too. Note that no distant Urls exist.<br>
 
: To declare such a repo, the following fields are required:
type example_service = {
:*'''mirror''' set to '''false'''
    'hosts' :  type_hostname[]
:* a '''snapshot_date''' (see step X.Y)
    'port' : type_port
    'master' : boolean
    'description' : string
    'option' ? string
};
</pre>


{{TracNotice|{{PAGENAME}}}}
3. '''direct''' repos: you use directly the distant repository, with only a proxypass and cache on our proxy.
: To declare such a repo, the following fields are required:
:*distant '''url''',
:*'''mirror''' set to '''false'''

Revision as of 14:15, 20 September 2017

Quick Summary

[0. on first time only] Edit sites/iihe-production/site/repositories.pan + runcheck
1. update repository:

On proxy, run /scripts/proxy/manage_repositories.pl --sync MY_REPO_NAME
OR On proxy add rpm to your repo in /var/www/html/local_repositories/

2. Make new snapshot:

On proxy, run /scripts/proxy/manage_repositories.pl --snapshot MY_REPO_NAME

3. Update snapshot date in quattor:

Edit sites/iihe-production/site/repositories.pan and modify the snapshot date in REPOSITORIES dict, OR to add new snapshot date for only one machine add the line
variable REPO_YUM_SNAPSHOT_DATE = update_snapshot_date_for_host('icinga2', 'sl6_epel', '1454598887');


I. Prepare the repo on the proxy server

a. Quattor config

You need to edit the file sites/iihe-production/site/repositories.pan and add your repository here:

    'elastic_5x_el', dict('descr', 'Elastic repository for 5.x packages',
                       'url', 'https://artifacts.elastic.co/packages/5.x/yum',
                       'mirror', true,
                       'snapshot_date', '1504525687'
                  ),

The repo name needs to follow those requirements:
1. First the repo name, with version if available
2 The el version it is for: el6 | el7 | el

  • el is if it works on whatever OS release number.
  • el7 repos should work for both sl7x and cos7x OS for instance

3. The architecture: x86_64 | noarch

  • If the repo contains packages for x86 & noarch, then omit the arch requirement


There are 3 types of repositories: mirrored, local or direct repos.

1. mirrorred repos are the most common ones: they will have a local mirror on our proxy, and are snapshoted.

To declare such a repo, the following fields are required:
  • distant url,
  • mirror set to true
  • a snapshot_date (see step X.Y)

2. local repos are our private ones, where we put ~random packages. They are snapshoted too. Note that no distant Urls exist.

To declare such a repo, the following fields are required:
  • mirror set to false
  • a snapshot_date (see step X.Y)

3. direct repos: you use directly the distant repository, with only a proxypass and cache on our proxy.

To declare such a repo, the following fields are required:
  • distant url,
  • mirror set to false