2012-10-08 19:35:54 +00:00
|
|
|
---
|
2016-06-25 17:52:30 +00:00
|
|
|
- name: Install desired extra packages (yum)
|
2015-05-13 23:34:00 +00:00
|
|
|
yum: state=present pkg={{ item }}
|
2013-06-25 18:31:36 +00:00
|
|
|
with_items:
|
|
|
|
- ntpdate
|
|
|
|
- ntp
|
2013-10-14 18:21:44 +02:00
|
|
|
- libsemanage-python
|
|
|
|
- libselinux-python
|
2015-05-27 22:27:39 +00:00
|
|
|
when: ansible_distribution_major_version|int < 22
|
2012-12-05 06:19:23 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2016-06-25 17:52:30 +00:00
|
|
|
- name: Install desired extra packages (dnf)
|
|
|
|
dnf: state=present pkg={{ item }}
|
|
|
|
with_items:
|
|
|
|
- ntpdate
|
|
|
|
- ntp
|
|
|
|
- libsemanage-python
|
|
|
|
- libselinux-python
|
2015-05-27 22:09:03 +00:00
|
|
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
2013-10-16 12:00:11 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2016-06-25 17:52:30 +00:00
|
|
|
- name: remove some packages (yum)
|
|
|
|
yum: state=absent pkg={{ item }}
|
|
|
|
with_items:
|
|
|
|
- chrony
|
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
when: ansible_distribution_major_version|int < 22
|
|
|
|
|
|
|
|
- name: remove some packages (dnf)
|
|
|
|
dnf: state=absent pkg={{ item }}
|
|
|
|
with_items:
|
|
|
|
- chrony
|
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
|
|
|
|
2012-12-05 06:19:23 +00:00
|
|
|
- name: put step-tickers in place
|
2016-01-06 21:25:10 +00:00
|
|
|
copy: src="{{ files }}/common/step-tickers" dest=/etc/ntp/step-tickers
|
2015-05-14 16:05:56 +02:00
|
|
|
when: ansible_cmdline.ostree is not defined
|
2015-09-07 15:53:13 +00:00
|
|
|
tags:
|
|
|
|
- ntp
|
|
|
|
- config
|
2012-12-05 06:19:23 +00:00
|
|
|
|
|
|
|
- name: enable the service
|
2016-01-06 21:25:10 +00:00
|
|
|
service: name=ntpd state=running enabled=true
|
2015-05-14 16:08:56 +02:00
|
|
|
when: ansible_cmdline.ostree is not defined
|
2012-12-05 06:19:23 +00:00
|
|
|
|
2014-10-04 23:39:47 +00:00
|
|
|
#- name: edit hostname to be instance name - prefix hostbase var if it exists
|
2016-01-06 21:25:10 +00:00
|
|
|
# shell: hostname {{ hostbase }}`curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
2014-10-04 23:39:47 +00:00
|
|
|
# tags:
|
|
|
|
# - config
|
2012-11-02 06:22:19 +00:00
|
|
|
|
2016-08-08 19:36:31 +00:00
|
|
|
- name: add ansible root key
|
2016-01-06 21:25:10 +00:00
|
|
|
authorized_key: user=root key="{{ item }}"
|
2013-06-17 13:54:17 +00:00
|
|
|
with_file:
|
2013-08-30 19:32:00 +00:00
|
|
|
- /srv/web/infra/ansible/roles/base/files/ansible-pub-key
|
2012-10-08 19:35:54 +00:00
|
|
|
tags:
|
|
|
|
- config
|
2015-07-13 13:36:06 +00:00
|
|
|
- sshkeys
|
2016-08-08 19:36:31 +00:00
|
|
|
|
2012-11-02 06:22:19 +00:00
|
|
|
- name: add root keys for sysadmin-main and other allowed users
|
2014-03-28 15:07:34 +00:00
|
|
|
authorized_key: user=root key="{{ item }}"
|
2015-03-17 21:23:00 +00:00
|
|
|
with_lines: "/srv/web/infra/ansible/scripts/auth-keys-from-fas @sysadmin-main {{ root_auth_users }}"
|
2012-10-26 17:31:32 +00:00
|
|
|
tags:
|
|
|
|
- config
|
2015-07-13 13:36:06 +00:00
|
|
|
- sshkeys
|
2013-07-02 19:26:24 +00:00
|
|
|
ignore_errors: true
|
2012-11-02 06:22:19 +00:00
|
|
|
|
2013-10-04 07:36:31 +00:00
|
|
|
- name: enable ssh_sysadm_login sebool
|
2016-01-06 21:25:10 +00:00
|
|
|
seboolean: name=ssh_sysadm_login state=yes persistent=yes
|
2015-11-27 00:05:36 +00:00
|
|
|
ignore_errors: true
|
2013-10-04 07:36:31 +00:00
|
|
|
|
2012-10-19 20:17:20 +00:00
|
|
|
# note - kinda should be a handler - but handlers need args
|
|
|
|
- name: restorecon
|
2016-06-25 18:09:34 +00:00
|
|
|
file: path=/root/.ssh setype=ssh_home_t recurse=yes
|
2012-10-19 20:17:20 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
2015-05-13 23:34:00 +00:00
|
|
|
- name: update all
|
|
|
|
command: yum -y update creates=/etc/sysconfig/global-update-applied
|
|
|
|
register: updated
|
2015-05-27 22:27:39 +00:00
|
|
|
when: ansible_distribution_major_version|int < 22
|
2015-05-13 23:34:00 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
|
|
|
- name: update all
|
|
|
|
command: dnf -y update creates=/etc/sysconfig/global-update-applied
|
|
|
|
register: updated
|
2015-05-27 22:27:39 +00:00
|
|
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
2015-05-13 23:34:00 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
|
|
|
- name: write out global-update-applied file if we updated
|
2016-08-08 19:36:31 +00:00
|
|
|
copy: content="updated" dest=/etc/sysconfig/global-update-applied
|
2015-05-13 23:34:00 +00:00
|
|
|
when: updated is defined
|
|
|
|
tags:
|
|
|
|
- packages
|