forked from LibreSchool/server-config
Inserita gestione chiave pubblica per amgmt. Cambiato ruolo di base per installazione con amgmt.
This commit is contained in:
parent
e5c5d02b6a
commit
0e4508f9ff
@ -2,50 +2,59 @@
|
|||||||
|
|
||||||
- name: Verifica configurazione CentOS 6
|
- name: Verifica configurazione CentOS 6
|
||||||
file: name=/etc/yum.repos.d/CentOS-Base.repo state=file
|
file: name=/etc/yum.repos.d/CentOS-Base.repo state=file
|
||||||
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: check_repos
|
register: check_repos
|
||||||
sudo: yes
|
|
||||||
|
|
||||||
- name: Scarico configurazione per CentOS 6
|
- name: Scarico configurazione per CentOS 6
|
||||||
get_url:
|
get_url:
|
||||||
url: http://mirror.centos.org/centos/6/os/x86_64/Packages/centos-release-6-6.el6.centos.12.2.x86_64.rpm
|
url: http://mirror.centos.org/centos/6/os/x86_64/Packages/centos-release-6-6.el6.centos.12.2.x86_64.rpm
|
||||||
dest: /tmp/centos-release-6-6.el6.centos.12.2.x86_64.rpm
|
dest: /tmp/centos-release-6-6.el6.centos.12.2.x86_64.rpm
|
||||||
when: check_repos|failed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: check_repos|failed
|
||||||
|
|
||||||
- name: Scompatto configurazione CentOS 6
|
- name: Scompatto configurazione CentOS 6
|
||||||
shell: mkdir -p /tmp/centos-release && pushd /tmp/centos-release && rpm2cpio ../centos-release-6-6.el6.centos.12.2.x86_64.rpm | cpio -idmv && popd
|
shell: mkdir -p /tmp/centos-release && pushd /tmp/centos-release && rpm2cpio ../centos-release-6-6.el6.centos.12.2.x86_64.rpm | cpio -idmv && popd
|
||||||
when: check_repos|failed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: check_repos|failed
|
||||||
|
|
||||||
- name: Copio i repository
|
- name: Copio i repository
|
||||||
shell: cp -f /tmp/centos-release/etc/yum.repos.d/* /etc/yum.repos.d/
|
shell: cp -f /tmp/centos-release/etc/yum.repos.d/* /etc/yum.repos.d/
|
||||||
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
when: check_repos|failed
|
when: check_repos|failed
|
||||||
register: centos_repo_installed
|
register: centos_repo_installed
|
||||||
sudo: yes
|
|
||||||
|
|
||||||
- name: Copio le chiavi di firma GPG
|
- name: Copio le chiavi di firma GPG
|
||||||
shell: cp -f /tmp/centos-release/etc/pki/rpm-gpg/* /etc/pki/rpm-gpg/
|
shell: cp -f /tmp/centos-release/etc/pki/rpm-gpg/* /etc/pki/rpm-gpg/
|
||||||
when: check_repos|failed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: check_repos|failed
|
||||||
|
|
||||||
# Senza di questa, non è possibile installare EPEL dopo
|
# Senza di questa, non è possibile installare EPEL dopo
|
||||||
- name: Prima attivazione repo
|
- name: Prima attivazione repo
|
||||||
shell: yum clean all && yum repolist
|
shell: yum clean all && yum repolist
|
||||||
when: centos_repo_installed|changed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: centos_repo_installed|changed
|
||||||
|
|
||||||
- name: Attivo EPEL
|
- name: Attivo EPEL
|
||||||
yum: name=epel-release state=present
|
yum: name=epel-release state=present
|
||||||
register: epel_installed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
register: epel_installed
|
||||||
|
|
||||||
- name: Seconda attivazione repo
|
- name: Seconda attivazione repo
|
||||||
shell: yum clean all && yum repolist
|
shell: yum clean all && yum repolist
|
||||||
when: epel_installed|changed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: epel_installed|changed
|
||||||
|
|
||||||
- name: Pulizia
|
- name: Pulizia
|
||||||
shell: rm -rf /tmp/centos-release && rm -f /tmp/centos-release-6-6.el6.centos.12.2.x86_64.rpm /tmp/epel-release-6-8.noarch.rpm
|
shell: rm -rf /tmp/centos-release && rm -f /tmp/centos-release-6-6.el6.centos.12.2.x86_64.rpm /tmp/epel-release-6-8.noarch.rpm
|
||||||
when: check_repos|failed
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: check_repos|failed
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
- name: Installo pacchetti di gestione
|
- name: Installo pacchetti di gestione
|
||||||
yum: name={{ item }} state=present
|
yum: name={{ item }} state=present
|
||||||
when: ansible_os_family == 'ClearOS'
|
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
remote_user: amgmt
|
||||||
|
when: ansible_os_family == 'ClearOS'
|
||||||
with_items:
|
with_items:
|
||||||
- vim-enhanced
|
- vim-enhanced
|
||||||
- git
|
- git
|
||||||
|
3
roles/firstsetup/defaults/main.yml
Normal file
3
roles/firstsetup/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
admin_sshkey: /Users/syntaxerrormmm/.ssh/id_rsa.pub
|
@ -7,3 +7,7 @@
|
|||||||
- name: Concessione permessi sudo
|
- name: Concessione permessi sudo
|
||||||
lineinfile: dest=/etc/sudoers line="amgmt ALL=(ALL:ALL) NOPASSWD:ALL" validate="visudo -cf %s" state=present
|
lineinfile: dest=/etc/sudoers line="amgmt ALL=(ALL:ALL) NOPASSWD:ALL" validate="visudo -cf %s" state=present
|
||||||
remote_user: root
|
remote_user: root
|
||||||
|
|
||||||
|
- name: Installazione chiave privata PC locale
|
||||||
|
authorized_key: user=amgmt key="{{ lookup('file', admin_sshkey) }}" state=present
|
||||||
|
remote_user: root
|
||||||
|
Loading…
x
Reference in New Issue
Block a user