From 92411123b4ba60e357a084e7abdb94d643ce00bb Mon Sep 17 00:00:00 2001 From: Yacine31 Date: Sun, 20 Jun 2021 21:04:22 +0200 Subject: [PATCH] nettoyage du code --- ansible_portable_howto.txt | 26 ---------- configure-host-oel7/README.md | 38 -------------- .../tasks/grub_configuration.yml | 3 -- .../tasks/kernel_configuration.yml | 3 -- configure-host-oel7/tasks/main.yml | 5 +- configure-host-oel7/templates/motd.j2 | 12 ----- .../templates/oracleasm-configure.expect.j2 | 50 ------------------- 7 files changed, 2 insertions(+), 135 deletions(-) delete mode 100644 ansible_portable_howto.txt delete mode 100755 configure-host-oel7/README.md delete mode 100755 configure-host-oel7/templates/motd.j2 delete mode 100755 configure-host-oel7/templates/oracleasm-configure.expect.j2 diff --git a/ansible_portable_howto.txt b/ansible_portable_howto.txt deleted file mode 100644 index cac7f49..0000000 --- a/ansible_portable_howto.txt +++ /dev/null @@ -1,26 +0,0 @@ -ansible sur le poste à configurer -s'inspirer de l'exemple screen ! - -=== - -yum install -y wget bzip2 - -wget https://github.com/ownport/portable-ansible/releases/download/v0.4.2/portable-ansible-v0.4.2-py2.tar.bz2 -tar xvfj portable-ansible-v0.4.2-py2.tar.bz2 - -ln -s ansible ansible-playbook - -creer un fichier hosts.oracle avec le contenu suivant - -[local] -localhost ansible_connection=local - -scp mes playbooks dans /root - -merlin@Dell-E7440:~/scripts/configure_oracle $ scp -r * root@192.168.1.241:/root - -ou rsync : -merlin@Dell-E7440:~/scripts/configure_oracle $ rsync -av * root@192.168.1.241:/root - -python ansible-playbook book-config-oel-6-7.yml -i hosts.oracle - diff --git a/configure-host-oel7/README.md b/configure-host-oel7/README.md deleted file mode 100755 index 225dd44..0000000 --- a/configure-host-oel7/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/configure-host-oel7/tasks/grub_configuration.yml b/configure-host-oel7/tasks/grub_configuration.yml index a3117a3..137eaa1 100755 --- a/configure-host-oel7/tasks/grub_configuration.yml +++ b/configure-host-oel7/tasks/grub_configuration.yml @@ -34,6 +34,3 @@ shell: grubby --grub2 --remove-args=quiet --update-kernel=ALL tags: quiet - - name: Configuration du mode 3 comme mode de démarrage par défaut - replace: dest=/etc/inittab regexp='id:5:initdefault:' replace='id:3:initdefault:' - diff --git a/configure-host-oel7/tasks/kernel_configuration.yml b/configure-host-oel7/tasks/kernel_configuration.yml index dc5c80b..01d6109 100755 --- a/configure-host-oel7/tasks/kernel_configuration.yml +++ b/configure-host-oel7/tasks/kernel_configuration.yml @@ -1,11 +1,8 @@ --- #------------------------------------------------------------------------------------ # configuration Linux : Paramètres du kernel - # pour Linux 7, on utilise un fichier de conf séparé /etc/sysctl.d/98-oracle.conf - # au lieu du fichier par défaut /etc/sysctl.conf #------------------------------------------------------------------------------------ - name: Ajustement des paramètres du Kernel - # sysctl: name={{ item.name }} value="{{ item.value }}" state=present reload=yes ignoreerrors=yes sysctl_file=/etc/sysctl.d/98-oracle.conf sysctl: name={{ item.name }} value="{{ item.value }}" state=present reload=yes ignoreerrors=yes sysctl_file=/etc/sysctl.conf with_items: - { name: kernel.shmall, value: "{{ ((0.4 * ansible_memtotal_mb)*1024*1024)|round|int }}" } diff --git a/configure-host-oel7/tasks/main.yml b/configure-host-oel7/tasks/main.yml index 9f8cf23..36afbe8 100755 --- a/configure-host-oel7/tasks/main.yml +++ b/configure-host-oel7/tasks/main.yml @@ -40,7 +40,7 @@ # configuration Linux : aliases bash & oracle # --------------------------------------------------- - name: Ajout du fichier bash_aliases dans /etc/profile.d - copy: src=bash_aliases dest=/etc/profile.d/bash_aliases.sh owner=root mode=644 + copy: src=bash_aliases dest=/etc/profile.d/z_bash_aliases.sh owner=root mode=644 # --------------------------------------------------- # configuration Linux : personnalisation rlwrap @@ -75,7 +75,6 @@ - libaio-devel - libaio-devel*i686 - libgcc -# - libgcc*i686 - libstdc++ - libstdc++*i686 - libstdc++-devel @@ -111,7 +110,7 @@ # Securisation de cron # --------------------------------------------------- - name: Desactivation de la commande crontab -r - lineinfile: dest=/etc/profile.d/you.sh + lineinfile: dest=/etc/profile.d/z_crontab_r.sh line='crontab () { [[ $@ =~ -[iel]*r ]] && echo "option -r (remove) not allowed" || command crontab "$@" ;}' state=present create=yes diff --git a/configure-host-oel7/templates/motd.j2 b/configure-host-oel7/templates/motd.j2 deleted file mode 100755 index 4cc1c96..0000000 --- a/configure-host-oel7/templates/motd.j2 +++ /dev/null @@ -1,12 +0,0 @@ ---------------------------------------- -Welcome to {{ ansible_fqdn }} -{{ ansible_distribution }} {{ ansible_distribution_version }} {{ ansible_userspace_architecture }} - -FQDN: {{ ansible_fqdn }} -IP: {{ ansible_default_ipv4.address }} - -#cpu's: {{ ansible_processor_vcpus }} -mem: {{ ansible_memtotal_mb }} MB -Kernel: {{ ansible_kernel }} - ---------------------------------------- diff --git a/configure-host-oel7/templates/oracleasm-configure.expect.j2 b/configure-host-oel7/templates/oracleasm-configure.expect.j2 deleted file mode 100755 index 3cec7ea..0000000 --- a/configure-host-oel7/templates/oracleasm-configure.expect.j2 +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/expect -f - -spawn service oracleasm configure -{% if role_separation==True %} -expect { - "Default user to own the driver interface*:" - { - send "{{ grid_install_user }}\r" - exp_continue - } - "Default group to own the driver interface*:" - { - send "{{ asmdba_group }}\r" - exp_continue - } - "Start Oracle ASM library driver on boot*:" - { - send "y\r" - exp_continue - } - "Scan for Oracle ASM disks on boot*:" - { - send "y\r" - exp_continue - } -} -{% else %} -expect { - "Default user to own the driver interface*:" - { - send "{{ oracle_user }}\r" - exp_continue - } - "Default group to own the driver interface*:" - { - send "{{ dba_group }}\r" - exp_continue - } - "Start Oracle ASM library driver on boot*:" - { - send "y\r" - exp_continue - } - "Scan for Oracle ASM disks on boot*:" - { - send "y\r" - exp_continue - } -} -{% endif %}