В любой новой установке CentOS 7 все команды (ls, host и т. Д.) Перестают работать, и я получаю следующие сообщения:
-bash: /bin/host: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
Я пробовал установить:
Но до сих пор не повезло. Не могли бы вы, пожалуйста, что происходит не так? Каждая развернутая система повреждается в произвольный момент времени с указанным выше сообщением.
РЕДАКТИРОВАТЬ: вот как я настраиваю свои системы:
- name: linux-cfg
hosts: all
roles:
- linux
become: yes
become_user: root
become_method: sudo
tasks:
# modprobe 8021q
# modprobe --first-time bonding
- name: "Deactivate NetworkManager"
systemd: name=NetworkManager enabled=no state=stopped
- name: "Deactivate firewalld"
systemd: name=firewalld enabled=no state=stopped
- name: "Disable SSH login as root"
replace: dest=/etc/ssh/sshd_config regexp='(.*)PermitRootLogin(.*)' replace='PermitRootLogin no'
- name: "Disable DNS lookup upon SSH"
replace: dest=/etc/ssh/sshd_config regexp='#UseDNS yes' replace='UseDNS no'
- name: "Configure the search domain"
lineinfile: dest=/etc/resolv.conf line="search {{ dns.name }}" state=present
- name: "Configure the nameservers"
lineinfile: dest=/etc/resolv.conf line="nameserver {{ item }}" state=present
with_items: "{{ dns.servers }}"
# - name: "Set the remote syslog server"
# lineinfile: dest=/etc/rsyslog.conf line="*.* @@{{ item }}:514" state=present
# with_items: "{{ syslog.servers }}"
- name: "Set the timezone on CentOS"
shell: timedatectl set-timezone Europe/Amsterdam ; hwclock --hctosys --utc ;
- name: "Set SELinux in 'permissive' mode"
replace: dest=/etc/sysconfig/selinux regexp='SELINUX=enforcing' replace='SELINUX=permissive'
- name: "Disable zeroconf route"
lineinfile: dest=/etc/sysconfig/network line="NOZEROCONF=yes" state=present
- name: "Update system packages"
yum: name=* state=latest
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
- name: "Install EPEL repository"
yum: name=epel-release state=latest
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
- name: "Clear the yum caches"
command: "yum clean all"
- name: "Install system packages"
yum: name="{{ item }}" state=latest
with_items:
- libselinux-python
- bash-completion
- net-tools
- bind-utils
- bridge-utils
- iptraf-ng
- net-snmp
- net-snmp-utils
- net-snmp-devel
- iotop
- htop
- sysstat
- lsof
- tcpdump
- strace
- psmisc
- watchdog
- telnet
- wget
- nc
- whois
- unzip
- git
- colordiff
- tree
- subnetcalc
- gcc
- libxml2-devel
- libxslt-devel
- openssl
- libffi-devel
- ansible
- erlang
- java-1.8.0-openjdk
# - qemu-kvm
# - qemu-img
# - virt-manager
# - libvirt
# - libvirt-python
# - libvirt-client
# - virt-install
# - virt-viewer
# - python-lxml
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
- name: "Configure SNMP settings"
template: src=roles/linux/templates/snmpd.conf.j2 dest=/etc/snmp/snmpd.conf owner=root group=root mode=0600
# - name: "Tune system settings: system.conf"
# replace: dest="/etc/systemd/system.conf" regexp='(.*)LogLevel=(.*)' replace='LogLevel=info'
- name: "Enable persistent boot information in '/var/log/journal'"
file: path="/var/log/journal" state=directory
- name: "Enable persistent boot information in '/etc/systemd/journald.conf'"
replace: dest="/etc/systemd/journald.conf" regexp='(.*)Storage=(.*)' replace='Storage=persistent'
- name: "Create user netops"
user: name="{{ secrets.USR_OPS }}" password="{{ secrets.PASS_OPS }}" createhome=yes shell=/bin/bash state=present
- name: "Create the 'netops' directory"
file: path="{{ dir.netops }}" state=directory owner=app group=app mode=777
- name: "Schedule the required administration safeguard"
cron: name="netops automation app" minute="00" job="find {{ dir.netops }} /* -mtime +30 -delete > /dev/null 2>&1" state=present
- name: "Edit MOTD"
copy: src=roles/linux/files/motd dest=/etc/motd owner=root group=root mode=644
и
---
- name: python-cfg
hosts: all
roles:
- linux
become: yes
become_user: root
become_method: sudo
tasks:
- name: "Install system packages"
yum: name="{{ item }}" state=latest
with_items:
- python34
- python34-setuptools
- python34-devel
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
- name: "Install Python (3) package index"
easy_install: executable=easy_install-3.4 name=pip state=latest
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
- name: "Install Python (3) libraries"
pip: executable=pip3 name="{{ item }}" state=present
with_items:
- ipython
- pyyaml
- psutil
- requests
- pycounters
- arrow
# - pandas
- marshmallow
- junos-eznc
- easysnmp
- celery
- flask
# - hug
# - curio
# - uvloop
- gunicorn
- redis
- psycopg2
- peewee
- prometheus_client
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
ОБНОВИТЬ:
проблема была в "пробеле" в crontab ниже
find {{ dir.netops }} /* -mtime +30 -delete
извините, ребята ..
Подводя итог тому, что произошло:
Существует определенная недоступная задача cron, которая запускается find {{ dir.netops }} /* -mtime +30 -delete
. Из-за пробела между {{ dir.netops }}
и /*
это будет оценивать find [...] /bin /lib /lib64 /boot [...] -mtime +30 -delete
и удалит практически каждый файл в системе через 30 дней после даты его «последнего изменения».
Это означает, что каждая система, развернутая с использованием этого доступного сценария, самоуничтожится через 30 дней.