    1  cd workspace_ansible/
    2  ansible-galaxy install --force -r /home/vagrant/workspace_ansible/requirements.yml
    3  ansible-galaxy collection init mbellahcene75.tools
    4  cd collections/
    5  ansible-galaxy collection init mbellahcene75.tools
    6  ls -al
    7  cd mbellahcene75/
    8  ls -al
    9  cd tools/
   10  ansible-galaxy collection build
   11  ansible-galaxy collection publish ./rrey-my_collection-1.0.0.tar.gz --api-key ansible-galaxy collection publish ./rrey-my_collection-1.0.0.tar.gz --api-key votre_cle_d_api_a_recuperer_sur_galaxy
   12  ansible-galaxy collection publish ./rrey-my_collection-1.0.0.tar.gz --api-key ansible-galaxy collection publish ./rrey-my_collection-1.0.0.tar.gz --api-key 2b1615e725445d5d0c5872a851cc29cd5f87b20e 
   13  ansible-galaxy collection publish ."/home/vagrant/workspace_ansible/collections/mbellahcene75/tools/mbellahcene75-tools-1.0.0.tar.gz"   --api-key ansible-galaxy collection publish ./rrey-my_collection-1.0.0.tar.gz --api-key 2b1615e725445d5d0c5872a851cc29cd5f87b20e 
   14  ansible-galaxy collect
   15  ansible-galaxy collection publish ./mbellahcene75-tools-1.0.0.tar.gz --api-key 2b1615e725445d5d0c5872a851cc29cd5f87b20e
   16  ansible-galaxy collection build
   17  rm -rf *.tar.gz
   18  ansible-galaxy collection build
   19  ansible-galaxy collection publish ./mbellahcene75-tools-1.0.0.tar.gz --api-key 2b1615e725445d5d0c5872a851cc29cd5f87b20e
   20  rm -rf *.tar.gz
   21  ansible-galaxy collection build
   22  ansible-galaxy collection publish ./mbellahcene75-tools-1.0.0.tar.gz --api-key 2b1615e725445d5d0c5872a851cc29cd5f87b20e
   23  history
   24  ansible-galaxy install --force -r requirement_collections.tml
   25  ansible-galaxy install --force -r requirement_collections.yml
   26  ansible-galaxy install --force -r rt.yml
   27  cd ..
   28  ansible-galaxy install --force -r rt.yml
   29  ansible-playbook tc.yml 
   30  ansible-galaxy install --force -r rt.yml
   31  history
   32  ansible-playbook tc.yml 
   33  history > history.txt




|
    if [[ -n "$CI_COMMIT_TAG" ]] && [[ "$CI_COMMIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
      export _VERSION="$CI_COMMIT_TAG"
    elif [[ -n "$CI_COMMIT_BRANCH" ]] && [[ "$CI_COMMIT_BRANCH" =~ master ]]; then
      export _VERSION="$(date +%Y%m%d).0.0"
    else
      exit 0
    fi
    sed -i "s/VERSION/$_VERSION/g" galaxy.yml
    ansible-galaxy collection build
    ansible-galaxy collection publish --token $ANSIBLE_GALAXY_TOKEN *.tar.gz

    

    ROLES ANSIBLE

    .script-ansible-galaxy-role-import: &script-ansible-galaxy-role-import
  - |
    if [[ -n "$CI_COMMIT_TAG" ]] && [[ "$CI_COMMIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
      export _USER="$CI_PROJECT_NAMESPACE"
      export _REPO="$CI_PROJECT_NAME"
    elif [[ -n "$CI_COMMIT_BRANCH" ]] && [[ "$CI_COMMIT_BRANCH" =~ master ]]; then
      export _USER="$CI_PROJECT_NAMESPACE"
      export _REPO="$CI_PROJECT_NAME"   
    else
      exit 0
    fi
    ansible-galaxy role import --token $ANSIBLE_GALAXY_TOKEN $_USER $_REPO
